aspose file tools*
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
Author

Spring 3 and Tomcat...newbie question

Kevin Marcus
Greenhorn

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
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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, http://j.mp/iJZRp

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
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 http://code.google.com/p/atinject/


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring 3 and Tomcat...newbie question
 
Similar Threads
Architecture planning with Spring and Appserver
Architecture problem: How to manage property files to the following scenario...
am i using resource injection correctly?
javax.inject.Inject and Tomcat 7
Any Simple Example on Spring with Hibernate