On a Tomcat 5.5 server, I put a class in the system classpath (and modify catalina.bat to pick it), or if I put class in the shared lib directory. Now if I have two differen
As comments say, you've correctly explained why you observed the behavior you observed.
The key is how ClassLoaders are structured. It's entirely possible for two ClassLoaders within one JVM to each load a class and therefore contains separate, independent copies of the static fields. "static" makes something 'global' to a ClassLoader, not a JVM. Tomcat, I suppose, could not hold a container-level ClassLoader with shared libraries, and somehow force each app ClassLoader to load shared libraries separately.
But that'd be a bit wasteful for other common classes like J2EE APIs and implementation. And in principle, classes shouldn't depend on this ClassLoader structure anyway.
This is why you should not put application dependencies in Tomcat's shared library folders. That is the 'solution'. It ties your application to the container's specific setup and deployment, which is against the principle of J2EE web apps. Just put copies of dependencies in WEB-INF/lib for each application.
The behavior you observe is another reason not to do this: apps become less isolated from one another. It doesn't strike me as counter-intuitive behavior, but that's I suppose just because I am used to how Tomcat works and thinks about these things.