tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Halicke" <>
Subject RE: Several configuration issues with Tomcat 5.5.7/Apache2 compiling JSPs - Fixed
Date Tue, 15 Feb 2005 21:39:48 GMT
It ended up being the CLASSPATH environment variable, which i suspected all

Since our underlying code (some of it poorly written AFAIK, based on Tomcat
3 and the older JSP spec) relies on classes/jars being at a certain path in
the directory tree, copying the classes over to the WEB-INF directories is
not enough. You won't get ClassDefNotFound errors, but you will get NPEs.
The exact reason for this, I don't know, (I have only a passing
understanding of Java and the JSP spec) but I did find a workaround. It lies
in the /bin/ script, in which the CLASSPATH environment variable
is overridden. I simply added the paths to my necessary .jar files in a
separate script run at login, exporting them to another env variable
(CLASSPATH2). I then edited $tomcat_home/bin/ to look like this:


# Add on extra jar files to CLASSPATH
if [ -n "$JSSE_HOME" ]; then




And voila, everything works fine. It's a good tip if you're migrating from
the Stone Age of Tomcat 3, as you don't have to re-code anything. If anyone
knows of an easier, more modular way to do this, please drop me a line.
Thanks for all your advice.


<orig message follows>

Forget classpath -- it's ignored in Tomcat 5.5 and as I remember, was
being phased out in Tomcat 3 (wow -- have I been reading these mail
lists for that long??).

If you put your classes and jars in the right places, they will be
found.  In your case, the classes are being found, but some underlying
code in biz.shipflex.Configuration is throwing an NPE.


Sam Halicke wrote:

>Hi all, first time posting to the list.
>I'm having several problems migrating JSPs and class/jar files to Tomcat
>5.5.7 from Tomcat 3. I understand this is a big move, but I'm trying to
>avoid any rewrite of the JSPs themselves. Documentation for tomcat 5.5.x is
>rather sparse and terribly cryptic.
>Each webapp is using its own local classes (which I have copied into the
>local WEB-INF directory in /classes /lib etc.), as well as some common
>classes/jars which have been copied into the /tomcat/common/ directory
>Should I be using the /tomcat/shared/ tree? This does not seem to matter as
>jasper will consistently throw me errors from compiling the JSPs.
>Here is the root cause of one such error:
>HTTP 500 - Internal Server Error
>	biz.shipflex.Configuration.getConfiguration(
>	org.apache.jasper.runtime.HttpJspBase.service(
>	javax.servlet.http.HttpServlet.service(
>	org.apache.jasper.servlet.JspServlet.serviceJspFile(
>	org.apache.jasper.servlet.JspServlet.service(
>	javax.servlet.http.HttpServlet.service(
>My basic setup is as follows:
>Apache 2.x 		/usr/local/apache
>Tomcat 5.5.7	/usr/local/tomcat
>[root@dev02 tomcat]# echo $CLASSPATH
>I have a feeling its something with my CLASSPATH, again, this is a touchy
>I'll gladly copy any portions of web.xml and/or server.xml, etc to an
>additional message if needed. Any help or suggestions on things/files to
>look at would be most appreciated.
>Sam Halicke
>Systems Administrator
>IMSure Network, Inc.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message