Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring 3 and Tomcat...newbie question

 
Kevin Marcus
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic