1 Reply Latest reply on Oct 20, 2008 12:24 PM by adrian.brock

    profileService and predetermined attachments

    emuckenhuber

      I have a simple test where i deploy a .ear with a single datasource,
      use profileService to update the jndi-name and restart AS:

      ManagedComponent comp = child.getComponent("ProfileServiceTestDS");
      ManagedProperty p = comp.getProperty("jndi-name");
      p.setValue(SimpleValueSupport.wrap("FooDsJNDIName"));
      mgtView.updateComponent(comp);
      mgtView.process();
      


      profileService persists the whole ManagedConnectionFactoryDeploymentGroup object as attachment, with the local-ds and the mbean.

      When i restart AS it fails with:
      javax.management.InstanceAlreadyExistsException: jboss.deployment:id="jboss:database=profileserviceTestDB,service=Hypersonic",type=Component already registered.
      


      In the log i see:
      2008-10-20 14:22:15,055 DEBUG [org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext] (main) Added component jboss:database=profileserviceTestDB,service=Hypersonic to vfszip:/home/emuckenh/svn/as/trunk/build/output/jboss-5.0.0.GA/server/profileservice/deploy/profilservice-datasource.ear
      ...
      2008-10-20 14:22:15,071 DEBUG [org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext] (main) Added component jboss:database=profileserviceTestDB,service=Hypersonic to vfszip:/home/emuckenh/svn/as/trunk/build/output/jboss-5.0.0.GA/server/profileservice/deploy/profilservice-datasource.ear/test-ds.xml
      


      Which looks like it is deploying the persisted ManagedConnectionFactoryDeploymentGroup for the .ear and the unmodified test-ds.xml. And fails, because the mbean is then specified twice :)
      Without the parent deployment it uses the predetermined attachment and deploys the datasource with the changed jndi-name.

      So basically what happens to restore the attachment is:
      * createVFSDeployment(profilservice-datasource.ear)
      * deployment.setPredeterminedManagedObjects(...)
      * mainDeployer.add(deployment)

      Now i'm wondering how those attachments should get populated to the child(s)?


        • 1. Re: profileService and predetermined attachments

           

          "emuckenhuber" wrote:

          So basically what happens to restore the attachment is:
          * createVFSDeployment(profilservice-datasource.ear)
          * deployment.setPredeterminedManagedObjects(...)
          * mainDeployer.add(deployment)

          Now i'm wondering how those attachments should get populated to the child(s)?


          The test-ds.xml should be against a subdeployment of the ear. Your problem is that
          you now have the -ds.xml attachment against the top level ear as a predetermined
          managed object and against the test-ds.xml subdeployment which is still created
          by the parsing deployer since it doesn't exist at that level.

          Have a look at jboss.deployment on the jmx-console for the ear to see what
          structure you should be using and where the attachments live.