[jboss-dev-forums] [Design of POJO Server] - profileService and predetermined attachments

emuckenhuber do-not-reply at jboss.com
Mon Oct 20 11:52:55 EDT 2008


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)?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4183288#4183288

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4183288



More information about the jboss-dev-forums mailing list