While on the subject of deployers,
If there is an exception while creating the ra then the Mbean is not rolledback and subsequent deployments will fail
with the error failed to create and register entity resource usage mbean
18:59:55,938 ERROR [SLEESubDeployer]
javax.slee.SLEEException: hostname can't be null (my error)
at
org.mobicents.slee.container.management.ResourceManagementImpl.createResourceAdaptorEntity(ResourceManagementImpl.java:227)
at
org.mobicents.slee.container.deployment.jboss.action.CreateResourceAdaptorEntityAction.invoke(CreateResourceAdaptorEntityAction.java:52)
at org.mobicents.slee.container.deployment.jboss.DeploymentManager.sciAction(DeploymentManager.java:316)
at
org.mobicents.slee.container.deployment.jboss.DeploymentManager.installDeployableUnit(DeploymentManager.java:181)
at org.mobicents.slee.container.deployment.jboss.SLEESubDeployer.start(SLEESubDeployer.java:281)
at
org.mobicents.slee.container.deployment.jboss.SleeContainerDeployerImpl.start(SleeContainerDeployerImpl.java:268)
at org.mobicents.slee.container.deployment.jboss.SLEEDeployer.callSubDeployer(SLEEDeployer.java:124)
at org.mobicents.slee.container.deployment.jboss.SLEEDeployer.setInternalDeployer(SLEEDeployer.java:170)
at
org.mobicents.slee.container.deployment.jboss.SleeContainerDeployerImpl$1.run(SleeContainerDeployerImpl.java:139)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
19:07:22,912 ERROR [SLEESubDeployer]
javax.slee.SLEEException: failed to create and register entity resource usage mbean
at
org.mobicents.slee.container.management.ResourceManagementImpl.createResourceAdaptorEntity(ResourceManagementImpl.java:204)
at
org.mobicents.slee.container.deployment.jboss.action.CreateResourceAdaptorEntityAction.invoke(CreateResourceAdaptorEntityAction.java:52)
at org.mobicents.slee.container.deployment.jboss.DeploymentManager.sciAction(DeploymentManager.java:316)
at
org.mobicents.slee.container.deployment.jboss.DeploymentManager.installDeployableUnit(DeploymentManager.java:181)
at org.mobicents.slee.container.deployment.jboss.SLEESubDeployer.start(SLEESubDeployer.java:281)
at
org.mobicents.slee.container.deployment.jboss.SleeContainerDeployerImpl.start(SleeContainerDeployerImpl.java:268)
at org.mobicents.slee.container.deployment.jboss.SLEEDeployer.callSubDeployer(SLEEDeployer.java:124)
at org.mobicents.slee.container.deployment.jboss.SLEEDeployer.deploy(SLEEDeployer.java:98)
at org.mobicents.slee.container.deployment.jboss.SLEEDeployer.deploy(SLEEDeployer.java:46)
at org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer.deploy(AbstractSimpleVFSRealDeployer.java:56)
at
org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.slee.SLEEException: javax.slee.management.usage:type=ResourceUsage,raEntityName="Http Resource Adaptor
Entity" already registered.
at org.mobicents.slee.container.management.jmx.ResourceUsageMBeanImpl.<init>(ResourceUsageMBeanImpl.java:70)
at
org.mobicents.slee.container.management.UsageParametersManagementImpl.newResourceUsageMBean(UsageParametersManagementImpl.java:72)
at
org.mobicents.slee.container.management.ResourceManagementImpl.createResourceAdaptorEntity(ResourceManagementImpl.java:199)
... 36 more
Caused by: javax.management.InstanceAlreadyExistsException:
javax.slee.management.usage:type=ResourceUsage,raEntityName="Http Resource Adaptor Entity" already registered.
at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:756)
at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:233)
at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)
at org.mobicents.slee.container.management.jmx.ResourceUsageMBeanImpl.<init>(ResourceUsageMBeanImpl.java:67)
> DeployableUnit.java.patch
>
>
> --- org/mobicents/slee/container/deployment/jboss/DeployableUnit.java 2010-12-28 04:28:10.000000000 +0100
> +++ src/main/java/org/mobicents/slee/container/deployment/jboss/DeployableUnit.java 2011-02-25 15:19:17.000000000 +0100
> @@ -52,9 +52,12 @@
> // A collection of the IDs of the components in this DU.
> private Collection<String> componentIDs = new ArrayList<String>();
>
> - // A collection of the IDs of the components that this DU depends on.
> + // A collection of the IDs of the components that this DU depends on.
> private Collection<String> dependencies = new ArrayList<String>();
>
> + // A collection of the IDs of the components that this DU depends on.
> + private Collection<String> deployDependencies = new ArrayList<String>();
> +
> // The install actions needed to install/activate this DU components.
> private Collection<Object[]> installActions = new ArrayList<Object[]>();
>
> @@ -116,13 +119,15 @@
> && postInstallActionsStrings.size() > 0) {
> installActions.addAll(postInstallActionsStrings);
> } else if (dc.getComponentType() == DeployableComponent.RA_COMPONENT) {
> +
> + /*
> ComponentID cid = dc.getComponentID();
>
> String raID = dc.getComponentKey();
>
> logger
> .warn("\r\n------------------------------------------------------------"
> - + "\r\nNo RA Entity and Link config for "
> + + "\r\nNo RA Entity **************** and Link config for "
> + raID
> + " found. Using default values!"
> + "\r\n------------------------------------------------------------");
> @@ -146,6 +151,8 @@
> "deactivateResourceAdaptorEntity", raName });
> uninstallActions.add(new Object[] { "removeResourceAdaptorEntity",
> raName });
> + *
> + */
> }
>
> // .. pre-uninstall actions (if any) ..
> @@ -175,6 +182,7 @@
> public Collection<String> getExternalDependencies() {
> // Take all dependencies...
> Collection<String> externalDependencies = new HashSet<String>(dependencies);
> + externalDependencies.addAll(deployDependencies);
>
> // Remove those which are contained in this DU
> externalDependencies.removeAll(componentIDs);
> @@ -271,7 +279,11 @@
> // Let's check if we have some remaining install actions
> if (postInstallActions.values().size() > 0) {
> for (String componentId : postInstallActions.keySet()) {
> - iActions.addAll(postInstallActions.get(componentId));
> + if (deployDependencies.contains(componentId)) {
> + iActions.addAll(0,postInstallActions.get(componentId));
> + } else {
> + iActions.addAll(postInstallActions.get(componentId));
> + }
> }
> }
>
> @@ -386,12 +398,14 @@
>
> // Get the JarEntry for the deploy-config.xml
> JarEntry deployInfoXML = componentJarFile.getJarEntry("META-INF/deploy-config.xml");
> +
logger.info("Deployment Configuration Found");
>
> // If it exists, set an Input Stream on it
> is = deployInfoXML != null ? componentJarFile.getInputStream(deployInfoXML) : null;
>
> if (is != null) {
>
> +
logger.info("Deployment Configuration Processing");
> // Read the file into a Document
> SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
> Schema schema = schemaFactory.newSchema(DeployableUnit.class.getClassLoader().getResource("deploy-config.xsd"));
> @@ -486,6 +500,9 @@
>
> for (int j = 0; j < links.getLength(); j++) {
> String linkName = ((Element) links.item(j)).getAttribute("name");
> +
logger.info("Removing Dependency " + linkName);
> + componentIDs.add(linkName.trim());
> +
>
> cPostInstallActions.add(new Object[] {"bindLinkName", entityName, linkName});
>
> @@ -513,8 +530,10 @@
> else {
> preUninstallActions.put(raId, cPreUninstallActions);
> }
> + deployDependencies.add(raId);
> }
>
> +
> // Now we clean the lists for the next round (might come a new RA ID)...
> cPostInstallActions = new ArrayList<Object[]>();
> cPreUninstallActions = new ArrayList<Object[]>();
> @@ -523,7 +542,10 @@
>
> }
> }
> + } catch (Exception ex){
> +
logger.info("Exception ",ex);
> }
> +
> finally {
> // Clean depoy-config.xml inputstream
> try {
>