Thanks for the suggestions, guys. This has been a tricky one to work
through but I think I have the answer - kind of.
A number of people responded with help for which I am grateful (think:
2am and I'm all alone and it has to be fixed by morning, it is so nice
to see a helpful message come through).
What I thought I was seeing was the static fields suddenly being shared
between two apps. I got reports of errors from the live site (to which I
have no direct access) and I reproduced a similar problem on my dev
environment. When I looked deeper I found the statics were shared
between the two apps so I concluded the same thing was happening on the
live site. It certainly explained what they reported from the live site.
But two different things were happening.
On my dev system I run tomcat under eclipse, using the plugin. It has
always worked fine. I recently started using ivy in my eclipse projects
and that seems to do something odd to the class loader which is what I
was seeing.
Filip Hanlik suggested I use this code to see how the classloader was
loading:
ClassLoader parent = this.getClass().getClassLoader();
while ( parent != null ) {
if (parent instance of URLClassLoader) {
//print URLs using getURLS() method
parent = parent.getParent();
}
I put a variation of this into my contextlisterner classes and it showed
this (edited for brevity)
10-05-2007 20:45:58 parent=org.apache.catalina.loader.WebappClassLoader
10-05-2007 20:45:58 file:/C:/projects/Hermes/HermesAdmin/WEB-INF/classes/
10-05-2007 20:45:58
file:/C:/projects/Hermes/HermesAdmin/WEB-INF/lib/HermesServer.jar
10-05-2007 20:45:58
file:/C:/projects/Hermes/HermesAdmin/WEB-INF/lib/MaduraApplet-2.0.jar
10-05-2007 20:45:58
file:/C:/projects/Hermes/HermesAdmin/WEB-INF/lib/MaduraServer-2.0.jar
<<<<<<<<<<<< This is the relevant library
10-05-2007 20:45:58 parent=org.apache.catalina.loader.StandardClassLoader
10-05-2007 20:45:58 file:C:/Program Files/Apache Group/Tomcat
4.1/shared/classes/
...
10-05-2007 20:45:58 parent=org.apache.catalina.loader.StandardClassLoader
10-05-2007 20:45:58 file:C:/Program Files/Apache Group/Tomcat
4.1/common/classes/
...
10-05-2007 20:45:58 parent=sun.misc.Launcher$AppClassLoader
10-05-2007 20:45:58 file:/C:/projects/Hermes/HermesServer/classes/
10-05-2007 20:45:58 file:/C:/eclipsev32/plugins/org.junit_3.8.1/junit.jar
10-05-2007 20:45:58
file:/C:/Program%20Files/Apache%20Group/Tomcat%204.1/common/lib/servlet.jar
...
10-05-2007 20:45:58
file:/C:/projects/ivy_resources_madura/ivy_cache/senanque/Madura/jars/MaduraServer-2.0.jar
<<<<<< and here it is again !!
10-05-2007 20:45:58
file:/C:/projects/ivy_resources_madura/ivy_cache/senanque/Madura/jars/MaduraApplet-2.0.jar
...
10-05-2007 20:45:58
file:/C:/projects/ivy_resources_madura/ivy_cache/apache/xerces/jars/xerces-2.0.2.jar
10-05-2007 20:45:58
file:/C:/Program%20Files/Apache%20Group/Tomcat%204.1/bin/bootstrap.jar
10-05-2007 20:45:58 file:/C:/j2sdk1.4.2_11/lib/tools.jar
10-05-2007 20:45:58 parent=sun.misc.Launcher$ExtClassLoader
10-05-2007 20:45:58 file:/C:/j2sdk1.4.2_11/jre/lib/ext/dnsns.jar
10-05-2007 20:45:58 file:/C:/j2sdk1.4.2_11/jre/lib/ext/ldapsec.jar
10-05-2007 20:45:58 file:/C:/j2sdk1.4.2_11/jre/lib/ext/localedata.jar
10-05-2007 20:45:58 file:/C:/j2sdk1.4.2_11/jre/lib/ext/sunjce_provider.jar
So the problem is that the ivy libraries are loading too early. I don't
see a way to control this from the eclipse UI but it is no problem to
test the apps one at a time. This might help someone else though.
I tried it running stand-alone on the tomcat 5.5 system on my dev
machine and thought I reproduced the error but I cannot now so I will
put that down to late night brain fade.
The live site has mysteriously righted itself. The only thing I know
they did there was to clear the app directories in webapps and restart
the server. It is just possible that they were doing something
ridiculous and not telling me, they aren't very used to tomcat. The most
likely scenario was that they had managed to get two instances of it
running and the phantom application was locking the real one. I'm
getting too specific to my app here, which is not useful, so I'll stop.
Anyway, thanks again for the help. I've mentioned Filip but the
responses from Christopher Schultz and Johnny Kewl were very welcome
too. Oh, and Christopher asked which library I was using. It isn't one
you'd know, a home grown framework used for internal projects.
Regards
Roger
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]