ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
You can put your jar file on any directory in the system, but seems you're doing something wrong.
Do you use Catalina to boot up tomcat? if not, you should use some other methods.
Using your 3rd method, the file may exist, but, if is not referenced on tomcat start up, it will be ignored...
Could you try this:
1. if tomcat is running, stop it
2. Put your jar files inside the lib folder under the tomcat directory
3. restart tomcat
4. test your servlet
that directory (tomcat/lib) is where i put any shared library. Let us know if this solution works for you.
I tried your suggestion, but still no joy.
Is there any way to get more log information from my servlet? Typically when I run it as a non-servlet, I would see a stack trace dump if it failed to start due to a ClassNotFoundException. However, in the 'catalina.out' log, all I see are messages indicating that the servlet started, but nothing indicating why it failed.
P.S. I start Tomcat using $CATALINA_HOME/bin/startup.sh
Last edited by dwhitney67; 04-10-2012 at 03:34 PM.
I looked at the "localhost" log file in $CATALINA_HOME/logs, and it indeed indicated that my application was having trouble loading a JNI library (because already loaded), and if I changed a thing or two, then the log indicated that a class could not be found, etc.
I used to place my JNI library (and other project related libraries) in $CATALINA_HOME/bin, but it seems to me that they are better off in $CATALINA_HOME/lib (Thank you for that suggestion).
As for the JAR file, I've placed it in WEB-INF/lib for now. If I attempt to place it in $CATALINA_HOME/lib, I continue to get the following error:
java.lang.UnsatisfiedLinkError: Native Library /home/me/Tomcat/apache-tomcat-7.0.27/lib/libacme_jni.so already loaded in another classloader