I have a tomcat 5.5 running on a server with redhat enterprise linux 5 and
everything has been working for the last 7 -8 months without problems. On
Friday the IT department "patched"/upgraded the server (I believe both tomcat
and java were moved up minor versions) and now any undeploy fails.
The steps for me to produce are.
1. Deploy any app
2. Attempt to undeploy
Fails. The message in tomcat manager is "FAIL - Encountered exception
javax.management.RuntimeErrorException: Error invoking method check"
The result of this is that the webapp disappears from the manager and is in
fact no longer running. However it cannot be redeployed again because the
unpacked WAR file as directory still exists. To be clear if after step 2 I look
in the webapps directory the WAR file will be gone, the WAR file that tomcat
unpacked will still be there. At this point attempting to deploy again will
fail.
If I restart tomcat then I can repeat both steps 1 and 2 again. That is after a
restart I can deploy.
What is in the log begins with
Aug 30, 2010 1:15:23 PM org.apache.commons.modeler.BaseModelMBean invoke
SEVERE: Exception invoking method check
java.lang.StackOverflowError
at sun.nio.cs.UTF_8.updatePositions(UTF_8.java:76)
at sun.nio.cs.UTF_8$Encoder.encodeArrayLoop(UTF_8.java:411)
at sun.nio.cs.UTF_8$Encoder.encodeLoop(UTF_8.java:466)
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:561)
at java.lang.StringCoding$StringEncoder.encode(StringCoding.java:258)
at java.lang.StringCoding.encode(StringCoding.java:290)
at java.lang.String.getBytes(String.java:954)
at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:243)
at java.io.File.isDirectory(File.java:771)
at org.apache.catalina.startup.ExpandWar.delete(ExpandWar.java:360)
And the last line, ExpandWar.delete continues on and on etc.
So something goes wrong trying to delete the old stuff, and it ends up
recursing forever (which seems odd behaviour to me but that's a different
issue). But why is it having this problem? It doesn't seem to be permission
based, it (Tomcat) extracts the WAR fine. And I don't see how it can be a file
locking issue since (a) this isn't windows (b) there is no NFS or any other
strangeness and (c) it isn't just failing to delete some jars but *everything*
in the unpacked WAR directory. All the jsps, everything in WEB-INF, etc.
I tried some "simple" things like making sure all my webapps were deployed by
the current tomcat and I have been searching on both Google and the Tomcat
bugdatabase to no avail. This behavior fits closest to the windows locking jars
problem but again that problem I can't see being the case here. If anyone has
any ideas of what this might or where to look or try next it would be greatly
appreciated.
Some information about the setup if it helps.
OS - 2.6.18-194.11.1.el5xen
JVM - 1.6.0_0-b16 (Sun)
Tomcat - Apache Tomcat/5.5.23