0 Replies Latest reply on Mar 14, 2003 2:54 PM by djolly

    Scope problem - same class in different webapps

    djolly

      I have two webapps that each contain copies of the same class (which contains a static variable) - both deployed in the same instance of JBOSS...

      If webappA sets it's instance of this static variable to "a", and then webappB set it's instance to "b", then webappA's instance becomes set to "b" as well.

      As I understand it, the two classes should not share the static variables - as long as the webapps are deployed 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 the EAR/META-INF dir.

      Unfortunately, this did nothing to correct the problem. Am I doing something wrong, or is there another way to keep those static variables local to their respective webapps?

      Thanks in advance.