As I understand it, the same class deployed in different webapps (in the same instance of Jboss) should not see each other's static variables - as long as the webapps are loaded with different classloaders. So I deployed them as EARs and put
<loader-repository>cl:loader=myapp.ear</loader-repository>
in the jboss-app.xml file inside each ear's /META-INF dir.
Unfortunately, this didn't solve the problem as the different webapps continue to set each other's static variables.
Any suggestions?
Thanks in advance.
The two ears should have distinct loader entries:
For myapp1.ear:
<loader-repository>myapp1:loader=myapp1.ear</loader-repository
For myapp2.ear:
<loader-repository>myapp2:loader=myapp2.ear</loader-repository>