Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

We have set up Tomcat 6 with

  • [TOMCAT_HOME]/lib - here is the standard tomcat release
  • [TOMCAT_BASE]/lib - here we like to add non standard additional jar file

However somehow I don't manage to get [TOMCAT_BASE]/lib jar files to be picked up by Tomcat. It appears that all my jar files out side tomcat are ignored.

Before starting Tomcat I set the CLASSPATH=[TOMCAT_BASE]\lib

-------- Edit

JAVA_ENDORSED_DIRS can be used for adding an additional folder with jar files to be loaded by Tomcat

share|improve this question
    
What OS are you running, and are you using a distro-packaged Tomcat? –  crb Sep 6 '10 at 11:02
    
Solaris 9, Tomcat 6.0.29 –  s5804 Sep 7 '10 at 8:41

2 Answers 2

Based on the documentation here, setting the CLASSPATH will be ignored by the tomcat init script. Additionally, there's really no way to trick Tomcat into looking elsewhere, unless you want to add it to one of the other directories mentioned on the aforementione dpage.

As usually with Java web applications, the question is: why? If you're using a third-party app, and you want to override a jar--well, you might as well just rebuild the ear If you're using your own app, then rebuilding the app (say, if you want one library for dev and another for prod) is the "Java way."

share|improve this answer
  1. Add it to $TOMCAT/lib
  2. Add it to $TOMCAT/webapps/YOURAPP/WEB-INF/lib
  3. Edit $TOMCAT/bin/catalina.sh (.bat) to code a new path

That's about it on how you're going to make it happen. On #2, if you're building your own warball and it's auto-unpacking then add it there, not on the direct filesystem.

share|improve this answer
    
your suggestion would work, however we are required to seperate Catalina home and base –  s5804 Sep 7 '10 at 8:42
    
Then #3 is how you need to go, edit catalina.sh and add your custom classpath to the bootstrap. –  troyengel Sep 7 '10 at 23:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.