I have a Spring beans.xml that specifies a certain class my.package.Class to be injected somewhere in my code by Autowiring. The program is actually a web application inside a Tomcat container. Now when I launch Tomcat the logfile tells me my.package.Class cannot be found, even though its JAR is both in the classpath and the web application's lib/ directory. Do I have to tell Tomcat or Spring where to find the JAR, too, and if so: how?
-
1is your .class file in folder WEB-INF/classes folder?Bhavik Shah– Bhavik Shah2012-10-25 13:14:39 +00:00Commented Oct 25, 2012 at 13:14
Add a comment
|
1 Answer
Make sure, you have this code in your context:
<context:annotation-config />
<context:component-scan base-package="package.autowire.context" />
For more info you better read http://springindepth.com/book/in-depth-ioc-autowiring.html
By the way, check the default output folder in your project build path. That could also be the cause.
1 Comment
Joko
Thanks a lot, that did the trick! I must say though that the Error description that Tomcat/Spring gave wasn't quite informative, don't you agree?