Tomcat Help

Ryan Ollerenshaw ryanollerenshaw at gmail.com
Fri Aug 4 16:35:26 UTC 2006


On 8/4/06, Chong Yu Meng <chongym at cymulacrum.net> wrote:
> On Fri, 2006-08-04 at 08:57 -0700, Ryan Ollerenshaw wrote:
>
> > so why is this not my classpath at run time??
>
> IIRC, Tomcat resets the classpath when it starts up, so it does not
> matter what you put in your system classpath or even if you tweak the
> startup.sh. I could be wrong though, since it has been years (literally)
> since I touched Tomcat.
>
> But if you want your JAR file to be in the classpath, there are two
> directories that I seem to recall where you can place the file:
>
> <tomcat-directory>/webapps/<servlet-name>/WEB-INF/classes/
> <tomcat-directory>/common/lib/
>
> But it would help if you could answer the following questions:
>
> 1. What is the URL that you key into the browser location bar to access
> the servlet? This is VERY important, because most problems come from the
> location and the mapping of the servlet.

http://neuron:8080/my_test/MapServer

> 2. What is the current location for your JAR file?

I have copies of it everywhere now trying to find the correct location
so fare i have used:
/etc/java/j2sdk1.4.2_12/jre/lib/ext/mapscript.jar
/etc/java/j2sdk1.4.2_12/lib/mapscript.jar
/etc/tomcat5/common/lib/mapscript.jar
/etc/tomcat5/shared/lib/mapscript.jar
/etc/tomcat5/webapps/my_test/WEB-INF/classes/mapscript.jar
/etc/tomcat5/webapps/my_test/WEB-INF/lib/mapscript.jar
/etc/tomcat5/webapps/my_test/WEB-INF/src/mapscript.jar


> 3. Does the web application get loaded at all? What are the errors in
> catalina.out when you startup Tomcat? You can check if the web
> application even exists in Tomcat by accessing the Manager web
> application (if you installed it).
>

The only error in my catalina.out file is: java.lang.NoClassDefFoundError
I can run a servelt just fine, but when i try to use this mapscript
library i keep running into problems.  I did create a servelt that
prints out the current classpath to the screen and i get:

/usr/java/j2sdk1.4.2_12/lib/tools.jar
/etc/tomcat5/bin/dist/commons-daemon.jar
/etc/tomcat5/bin/bootstrap.jar

And i dont know and cant find online where this classpath is getting
set.  As suggested on the web i have added the following to
./startup.sh

export CLASSPATH=./mapscript.jar:.:/etc/tomcat5/webapps/my_test/WEB-INF/classes

and also added the following to /etc/tomcat5/webapps/my_test/.classpath

<classpathentry kind="var" path="TOMCAT_HOME/common/lib/mapscript.jar"/>




More information about the fedora-list mailing list