Reputation: 176
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?
Upvotes: 1
Views: 5873
Reputation: 3088
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.
Upvotes: 3