3 Replies Latest reply on Aug 23, 2006 2:21 PM by doug.palmer

    MBean redeploy bug?

    doug.palmer

      I have a problem with the following in an MBean:

      package decs2.deployment;
      
      import javax.xml.bind.*;
      import org.jboss.deployment.*;
      import fuse.data.process_definition.*;
      
      public class DecsDeployer extends SubDeployerSupport implements DecsDeployerMBean
      {
       private static final String[] DEFAULT_ENHANCED_SUFFIXES = new String[]{"900:-process.xml"};
      
       public DecsDeployer()
       {
       setEnhancedSuffixes(DEFAULT_ENHANCED_SUFFIXES);
       }
      
       public void create(DeploymentInfo deploymentInfo) throws DeploymentException
       {
       try
       {
       JAXBContext jc = JAXBContext.newInstance("fuse.data.process_definition");
       }
       catch(Exception e)
       {
       throw new DeploymentException(e);
       }
       }
      }
      


      Obviously the MBean does more than this but cutting it down to this shows the problem.

      I package the MBean and it's interface in a jar file; I also include the fuse package in the jar file and a -service.xml file. If I deploy the jar file then everything works fine and my MBean works as expected. However, if I:

      1. Deploy my MBean.
      2. Call create on my MBean
      3. Redeploy my MBean
      4. Call create on my MBean

      The second call to create fails because JAXBContext can't find the classes for the package 'fuse'. Is there a stage I have missed or is there a bug with MBean redeployment?

      Regards
      Doug

        • 1. More information...
          doug.palmer

          It looks like this is a class loader problem. The MBean manages to read a .properties file from the fuse package but can't load classes from the same package. I can manufacture the same stack trace on first deploy of the MBean if I don't add the fuse package classes to the jar file. If I don't add the .properties file to the jar file then I get a different stack trace.

          I'm guessing that the class loader isn't being configured properly when the MBean is deployed a second time.

          Regards
          Doug

          • 2. Class loader log...
            doug.palmer

            Hello again

            I have configured log4j to log the class loader. Then I started jboss with my MBean deployed. Then I redeployed my MBean; this generates the error. Then I shutdown jboss.

            The resulting log file can be found here:
            http://rookhope.ncl.ac.uk/ucl.log.txt

            Does this help?

            Regards
            Doug[/url]

            • 3. More information...
              doug.palmer

              This bug only occurs if I put the fuse package in my service/application. If I jar the fuse package seperately and put it in jboss/server/default/lib then the MBean works. The MBean continues to work after a redeploy too.

              I'm guessing this is related to the class loading problems that the hibernate service people suffered?

              Regards
              Doug