2 Replies Latest reply on Jan 29, 2009 12:43 PM by sshetty

    Scoped classloader not working

      Hi,

      I have a java singleton class, that is included in 2 esbs. I want each esb to have its own instance of the singleton class and therefore trying to use a scoped class loader. The singleton class in initialized with a different set of properties.

      I have added the following entry to the deployment.xml in both the esbs:

      <jbossesb-deployment>
       <loader-repository>
       com.cmte:loader=esb1.esb
       <loader-repository-config>
       java2ParentDelegation=false
       </loader-repository-config>
       </loader-repository>
      ...
      </jbossesb-deployment>
      


      and

      <jbossesb-deployment>
       <loader-repository>
       com.cmte:loader=esb2.esb
       <loader-repository-config>
       java2ParentDelegation=false
       </loader-repository-config>
       </loader-repository>
      ...
      </jbossesb-deployment>
      


      When I deploy esb1.esb, it deploys fine and works as expected.
      However, when I deploy esb2, it is using the singleton instance from esb1 and has doesnt work as expected.

      Also I dont see a different loader created for esb1 and esb2 on the JMX console.

      http://localhost:8080/jmx-console
      


      How can I debug this and confirm jboss is using a different class loader for each esb ?

      I am trying this on jbossesb-server-4.4.GA.

      Thank you

      :)
      SShetty


        • 1. Re: Scoped classloader not working
          kconner

          If you do not have the classloaders in the jmx-console, using those names, then you have something wrong in the configuration and it is not taking effect.

          I can't see anything wrong with the configuration you have included so we would need to see the log around the deployment of the esbs.

          • 2. Re: Scoped classloader not working

            I had deployment.xml in the root folder instead of META-INF/deployment.xml and some jars were missing.

            Have it working now. Thanks Kevin.

            :)
            SShetty