You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dan 'Dante' Tenenbaum <da...@dandante.com> on 2001/12/14 00:13:17 UTC

classloader oddities

I just upgraded to Tomcat 4.01 from 3.1 on a Windows 2000 machine.

I have some classes that I want to be visible from all webapps so I put them in $CATALINA_HOME/classes/com/mysite/mypackage and I put the JARs I need in $CATALINA_HOME/lib.

Now, in the web.xml of a particular webapp, I set <servlet-class> to a simple Hello, world servlet. When I invoke that servlet from the browser it works fine.

If I change that <servlet-class> to the class I really want it to be, a class that requires xalan.jar, and restart tomcat, tomcat never starts (it gets stuck between starting Tomcat-Standalone and Tomcat-Apache). The same thing happens when I move my classes to <webapp-home>/WEB-INF/classes/com/mysite/mypackage and my jars to <webapp-home>/WEB-INF/lib.

Here's the really weird part. I can get my servlet to run if I do the following steps:

1) In web.xml for my webapp, change <servlet-class> to point to my innocous Hello, World servlet. 
2) Start tomcat
3) Using the tomcat Manager app, stop this webapp
3) change web.xml so that <servlet-class> points to where I really want it to point to (the class that uses classes in xalan.jar)
4) Using the tomcat Manager app, I start the webapp

If I do all that, I can run my webapp. If I simply try and start tomcat (with <servlet-class> pointing where it should be pointing) I cannot.

One other thing I noticed; I think xalan.jar is partially to blame here. If I remove xalan.jar (the version from jdk1.3) from <webapp-home>/WEB-INF/lib (or $CATALINA_HOME/lib, whichever place I have it in), the server will start. Of course, I can't run my servlet, so this is small comfort.



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>