0 Replies Latest reply on May 22, 2009 2:01 AM by sada abc

    Static variable gets shared in 2 applications

    sada abc Newbie

      Hi,

      I have two turbine appliactions deployed in JBoss 4.0.4GA default profile. Actually turbine jar is packaged seperately in 2 ears but still static variables in turbine servlet are getting shared between 2 applications.

      I have added jboss-app.xml in meta-inf of both ear files e.g.
      <jboss-app>
      <loader-repository>
      test:loader=test.ear
      <loader-repository-config>
      java2ParentDelegation=false
      </loader-repository-config>
      </loader-repository>
      </jboss-app>

      After adding above, applications are not getting deployed. It throws exception like,
      java.lang.NoClassDefFoundError: java/lang/Object
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
      at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:672)
      at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:652)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      I am not getting why this is not working?
      Can anybody gives solution?

      If I add above jboss-app.xml for test applications having only servlet(common to both) then it works fine (static var is not getting shared). But it doesn't work for my turbine application where there are too many jars ejbs etc.

      Please give suggestions if anybody has.

      Thanks in advance.