You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Simon Brooke <si...@jasmine.org.uk> on 2003/08/26 16:56:37 UTC

JAR file symlink weirdness

I've always used symlinks for most of the JAR files in 
/webapps/mywebapp/WEB-INF/lib directories, and it's always worked. I've got a 
show-and-tell for a customer coming up on Thursday, and had been getting 
stuff ready for that, when suddenly the critical webapp just stopped working, 
and on inspection it turned out that it was failing to load JAR files, after 
successfully 'deploying' them. This didn't just apply to my JAR files but 
also to (Sun's) mail.jar and (Jakarta's) regexp-1.2.jar.

After a lot of threshing about I proved that this behaviour was reproducable 
with Tomcat 4.0.4 and Tomcat 4.1.12 and with Sun or Blackdown JDK 1.4.1, Sun 
JDK 1.4.0, and IBM JDK 1.3. Previously, my webapps had worked satisfactorily 
in all these configurations. And, furthermore, most of my webapps still did.

Very, very bizarre. The only relevent thing I could think of that had changed 
was that I'd switched from Emacs to Eclipse as my build tool, and I couldn't 
see how that could make a difference.

When I replaced the symlinks with actual copies of the jar files, suddenly 
everything was happy again. However, other webapps continued to work even 
though they still had symlinks.

I now think that the problem was caused by the fact that the webapp that 
failed had a symlink to xerces.jar, but there was in fact no file where the 
symlink pointed. However, xerces.jar was never the file complained about in 
the error messages. Always the file that was complained about was another 
file which was a symlink but where the symlink correctly resolved.

So there's some weirdness in the load-and-deploy-jar-files-for-webapp stuff, 
and it's related to symlinks. I'll try to produce a more complete 
characterisation of the bug and file a bug report, but in the mean time if 
you're struggling with wierdness about jar file loading check your symlinks.

Cheers

Simon

-- 
simon@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/

	For office use only. Please do not write or type below this line.