On 8/3/06, Ryan Ollerenshaw <ryanollerenshaw@xxxxxxxxx> wrote:
I am able to compile a java mapscript file from the command line using: javac -classpath ./mapscript.jar MapServerTest.java But when i try to turn my code into a servelt and run it over Tomcat i keep getting: java.lang.UnsatisfiedLinkError: no mapscript in java.library.path I have tried adding: export CLASSPATH=./mapscript.jar to my ./tomcat5/bin/startup.sh file but that does not seem to help. Am i missing a setting somewhere, why cant Tomcat find the .jar file? I have it in the same directory as my .java file and also in /common/lib and /shared/lib Thank you for any help that you can provide
Getting closer to the solution. I have found i can use the following code to print out the classpath that my program is actaully using the code is: Get the System Classloader ClassLoader sysClassLoader = ClassLoader.getSystemClassLoader(); //Get the URLs URL[] urls = ((URLClassLoader)sysClassLoader).getURLs(); for(int i=0; i< urls.length; i++) { out.println(urls[i].getFile()); out.println("<br>"); } and the classpath that is printed is: /usr/java/j2sdk1.4.2_12/lib/tools.jar /etc/tomcat5/bin/dist/commons-daemon.jar /etc/tomcat5/bin/bootstrap.jar But i am not sure where this is getting set, i do have the following in my /tomcat5/bin/startup.sh export CLASSPATH=./mapscript.jar:.:/etc/tomcat5/webapps/my_test/WEB-INF/classes so why is this not my classpath at run time??