File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Spring 3 and Tomcat...newbie question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring 3 and Tomcat...newbie question" Watch "Spring 3 and Tomcat...newbie question" New topic

Spring 3 and Tomcat...newbie question

Kevin Marcus

Joined: Jun 27, 2010
Posts: 11
Folks- I am new to Spring and trying out an example from Craig Walls' new book, "Spring in Action 3". It uses javax.inject.Inject. I am using Tomcat 7.0.10 and was getting an 'Import not found' error. I got a reply (thank you) in the Tomcat forum that Tomcat is not fully Java EE 6 compliant.

My question is...

Does this mean one may not use Spring 3 with Tomcat 7?
or is there an alternative to javax.inject.Inject I could use?

As I'm new to Spring, was it a mistake going with the 3rd Edition? should have tried 2.5 first?

I work for a small company and we cannot afford Webpshere or WebLogic, I thought we could go with Tomcat+Spring, with a small budget what are our options as far as an Application server is concerned?

I understand this may not be the right forum to ask, sorry for that.

Thank you.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

All you need to do is include the jar that has that Annotation definition in it for compile time.

At runtime, you need a Spring jar file that has a class that acts on that @Inject annotation,


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Spring 2.5 works on Tomcat w/o further contortions, but I think it should be possible to use Spring 3 as well. If that class/package is all that's missing, you can get it from
I agree. Here's the link:
subject: Spring 3 and Tomcat...newbie question
It's not a secret anymore!