1 Reply Latest reply on Jul 19, 2004 6:44 PM by Andrew Tyson

    XMBean deployment via EAR JBoss 3.2.3 problem

    Andrew Tyson Newbie

      Hi ,

      I have a few XMBean components that I have successfully been codeploying to a 3.2.3 container. Originally the XMBean components were deployed in a separate SAR, whilst WAR, EJB and JAR content was deployed in an EAR. To simplify the deployment process I have incorporated the SAR deployment units into the EAR (using the JBoss specific jboss-app.xml deployment descriptor).

      When I deploy the content now the XMBeans appear to be deploying fine, however all of the WAR and EJB jar content is failing with the following JNDI related issues;

      1. Example of failed WAR;

      2004-07-05 17:43:55,315 ERROR [org.jboss.deployment.MainDeployer] could not star
      t deployment: file:/home/at/jboss-3.2.3/server/default/tmp/deploy/tmp7270CFS.ear
      org.jboss.deployment.DeploymentException: Error during deploy; - nested throwabl
      e: (javax.naming.NameAlreadyBoundException; remaining name 'env')
       at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:44
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
       at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)

      ... snip ...

      2. Example of failed EJB;

      2004-07-05 17:43:47,822 ERROR [org.jboss.ejb.MessageDrivenContainer] Starting fa
      javax.naming.NameAlreadyBoundException; remaining name 'env'
       at org.jnp.server.NamingServer.createSubcontext(NamingServer.java:451)
       at org.jnp.interfaces.NamingContext.createSubcontext(NamingContext.java:
       at org.jnp.interfaces.NamingContext.createSubcontext(NamingContext.java:
       at org.jboss.ejb.Container.setupEnvironment(Container.java:765)
       at org.jboss.ejb.Container.startService(Container.java:572)
       at org.jboss.ejb.MessageDrivenContainer.startService(MessageDrivenContai
       at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
       at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea

      Doing a few Google searches, and scouring this site has not got me any closer to figuring out what I am doing wrong. There is an example in the JBoss 3.2.3 Admin and Dev Guide that successfully demonstrates co-deploying EJB and SAR content in a single EAR (although in this case a standard MBean is used, rather than an XMBean). I would appreciate any assistance that anyone might give.

      Thanks and regards,

        • 1. Re: XMBean deployment via EAR JBoss 3.2.3 problem
          Andrew Tyson Newbie


          The problem stems from some example XMBean code that I grafted from the 'Admin & Dev Guide' and managed to break.

          The XMBean exposes its JNDI name as an attribute. The setter method for the attribute is responsible for unbinding an existing JNDI name, before binding the new JNDI name that has just been set. Unfortunately at start-up this property is not set, and as a result the unbind operation was failing with a NamingException. This didn't seem to affect the XMBean, however caused other content like WAR and EJB to fail to load.

          When loading the EAR first, and subsequently deploying the SAR content subsequently the problem is avoided because the WAR/EJB content has successfully been initialised.

          Thanks and regards,