• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tomcat lib directory  RSS feed

 
richard marais
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have installed Tomcat app server 4.0. I export a .war file to the %catalina_home%\webapps\ directory. When I start the server, it unpacks the .war file correctly, but I get a java.lang.NoClassDefFoundError because my application needs some 3rd party classes to run (jaxb-api.jar).
I have got the jaxb-api.jar file in the %catalina_home%\webapps\xrad2\WEB-INF\lib\ directory. If I copy it to the %catalina_home%\lib directory, my application runs fine.
My question is, how can I get Tomcat to look at my applications lib directory for the third party classes? Resin app server seems to be able to do this. Can Tomcat?
The reason I want to be able to do this, is because many users will be installing this application on different types of app servers, and I want to keep the configuration issues to a minimum. I don't want them to have to copy the 3rd party classes, they should be part of the .war file.
Thanks
 
Brian Glodde
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your .war file extract to webapps/xrad2? Why not package the 3rd party classes with the application? Then you'd assure everything is unpacked as a whole. Copying it to %catalina_home%\lib makes it visible to all webapps...
 
richard marais
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the application does unpack to %catalina_home%\webapps\xrad2\...
I do have my 3rd party classes in the .war file, so they get unpacked too ( %catalina_home%\webapps\xrad2\WEB-INF\lib\ ).
Is this the correct directory to put them in? Why does Tomcat not see them?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!