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

    Scoped classloader not working

    S Shetty Newbie

      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