9 Replies Latest reply on Mar 10, 2009 3:52 PM by Wolfgang Knauf

    MDB redeploy with ...-service.xml

    Wolfgang Knauf Master

      Hi all,

      I try to deploy an EJB3 MDB to JBoss 5.0GA, and I want to do the Queue config trough a ...-service.xml file in the EJB jar.

      Here is the config file:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE server
       PUBLIC "-//JBoss//DTD MBean Service 5.0//EN"
       "http://www.jboss.org/j2ee/dtd/jboss-service_5_0.dtd">
      <server>
       <mbean code="org.jboss.jms.server.destination.QueueService"
       name="knauf:service=Queue,name=MessageBeanQueue"
       xmbean-dd="xmdesc/Queue-xmbean.xml">
       <attribute name="JNDIName">queue/MessageBeanQueue</attribute>
       <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
       <depends>jboss.messaging:service=PostOffice</depends>
       </mbean>
      </server>


      This works fine on first deploy. But on every redeploy, I see those error messages in the console:
      22:33:04,796 WARN [AbstractDeploymentContext] Unable to register deployment mbean vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar/knaufmq-service.xml
      javax.management.InstanceAlreadyExistsException: jboss.deployment:id="vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar/knaufmq-service.xml",type=SubDeployment already registered.
       at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
       at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)
       at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       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)
      ...
      MDB deployment output
      ...
      22:33:05,000 WARN [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1053a6b(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@15d0009 destination=queue/MessageBeanQueue destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
      javax.naming.NameNotFoundException: MessageBeanQueue not bound
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
       at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
       at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
       at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:673)
       at javax.naming.InitialContext.lookup(Unknown Source)
       at org.jboss.util.naming.Util.lookup(Util.java:222)
       at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDestination(JmsActivation.java:464)
       at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:352)
       at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:729)
       at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
       at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
       at java.lang.Thread.run(Unknown Source)
      22:33:05,031 INFO [QueueService] Queue[queue/MessageBeanQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
      22:33:15,000 INFO [JmsActivation] Attempting to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1053a6b(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@15d0009 destination=queue/MessageBeanQueue destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
      22:33:15,015 INFO [JmsActivation] Reconnected with messaging provider.
      


      Nevertheless, my app works fine. When deleting the EAR file, the queue is removed from JNDI view.

      Configuring the app through "destinations-service.xml" works fine.

      I created a full sample here:
      http://www.informatik.fh-wiesbaden.de/~knauf/private/mdb/service/
      (deploy EAR file to jboss, then use "startclient.bat" + "MessageClient.jar " + "log4j.properties" to start the app client => click on "Send message" button to send a message to the server).

      Can someone help me with this error? Am I doing something wrong? Is this a deployment error of JBoss5?

      Thanks

      Wolfgang

        • 1. Re: MDB redeploy with ...-service.xml
          jaikiran pai Master

           

          But on every redeploy


          How do you redeploy the application? Where exactly in the jar is the *-service.xml located? And can you post the console logs when do deploy then redeploy your application?

          • 2. Re: MDB redeploy with ...-service.xml
            jaikiran pai Master

             

            Where exactly in the jar is the *-service.xml located?


            I see it's at the root of your jar file.

            • 3. Re: MDB redeploy with ...-service.xml
              Wolfgang Knauf Master

              Hi Jaikiran,

              thanks for your reply.

              I simply copy the EAR to the deploy folder.

              On first deploy, this is the console output:

              20:10:29,250 WARN [AbstractDeploymentContext] Unable to register deployment mbean vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar/knaufmq-service.xml
              javax.management.InstanceAlreadyExistsException: jboss.deployment:id="vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar/knaufmq-service.xml",type=SubDeployment already registered.
               at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
               at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)
               at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
               at java.lang.reflect.Method.invoke(Unknown Source)
               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.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:989)
               at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:998)
               at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:998)
               at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.postRegister(AbstractDeploymentContext.java:964)
               at org.jboss.mx.server.AbstractMBeanInvoker.invokePostRegister(AbstractMBeanInvoker.java:974)
               at org.jboss.mx.server.AbstractMBeanInvoker.postRegister(AbstractMBeanInvoker.java:681)
               at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:338)
               at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
               at java.lang.reflect.Method.invoke(Unknown Source)
               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.jboss.deployers.plugins.deployers.DeployersImpl.registerMBean(DeployersImpl.java:1602)
               at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:755)
               at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
               at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
               at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
               at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
               at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
               at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
               at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
               at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
               at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
               at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
               at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
               at java.lang.Thread.run(Unknown Source)
              20:10:29,437 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@24665615{vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar}
              20:10:29,437 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@24665615{vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar}
              20:10:29,484 INFO [JBossASKernel] Created KernelDeployment for: MessageClient.jar
              20:10:29,484 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=Message.ear,jar=MessageClient.jar,name=MessageClient,service=EJB3
              20:10:29,484 INFO [JBossASKernel] with dependencies:
              20:10:29,484 INFO [JBossASKernel] and demands:
              20:10:29,500 INFO [JBossASKernel] and supplies:
              20:10:29,500 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=Message.ear,jar=MessageClient.jar,name=MessageClient,service=EJB3) to KernelDeployment of: MessageClient.jar
              20:10:29,796 INFO [JBossASKernel] Created KernelDeployment for: MessageEJB.jar
              20:10:29,796 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=Message.ear,jar=MessageEJB.jar,name=MessageBean,service=EJB3
              20:10:29,796 INFO [JBossASKernel] with dependencies:
              20:10:29,796 INFO [JBossASKernel] and demands:
              20:10:29,796 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
              20:10:29,796 INFO [JBossASKernel] and supplies:
              20:10:29,796 INFO [JBossASKernel] jndi:null
              20:10:29,796 INFO [JBossASKernel] Class:javax.jms.MessageListener
              20:10:29,796 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=Message.ear,jar=MessageEJB.jar,name=MessageBean,service=EJB3) to KernelDeployment of: MessageEJB.jar
              20:10:29,828 INFO [ClientENCInjectionContainer] STARTED CLIENT ENC CONTAINER: MessageClient
              20:10:29,890 INFO [EJBContainer] STARTED EJB: de.fhw.komponentenarchitekturen.knauf.mdb.MessageBean ejbName: MessageBean


              Then I delete the EAR and wait some seconds. Output is:
              20:11:40,984 INFO [QueueService] Queue[queue/MessageBeanQueue] stopped
              20:11:41,062 INFO [EJBContainer] STOPPED EJB: de.fhw.komponentenarchitekturen.knauf.mdb.MessageBean ejbName: MessageBean
              20:11:41,125 INFO [ClientENCInjectionContainer] STOPPED CLIENT ENC CONTAINER: MessageClient


              And now I copy the EAR again:
              20:12:11,265 WARN [AbstractDeploymentContext] Unable to register deployment mbean vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar/knaufmq-service.xml
              javax.management.InstanceAlreadyExistsException: jboss.deployment:id="vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar/knaufmq-service.xml",type=SubDeployment already registered.
               at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
               at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)
               at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
               at java.lang.reflect.Method.invoke(Unknown Source)
               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.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:989)
               at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:998)
               at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:998)
               at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.postRegister(AbstractDeploymentContext.java:964)
               at org.jboss.mx.server.AbstractMBeanInvoker.invokePostRegister(AbstractMBeanInvoker.java:974)
               at org.jboss.mx.server.AbstractMBeanInvoker.postRegister(AbstractMBeanInvoker.java:681)
               at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:338)
               at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
               at java.lang.reflect.Method.invoke(Unknown Source)
               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.jboss.deployers.plugins.deployers.DeployersImpl.registerMBean(DeployersImpl.java:1602)
               at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:755)
               at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
               at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
               at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
               at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
               at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
               at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
               at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
               at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
               at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
               at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
               at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
               at java.lang.Thread.run(Unknown Source)
              20:12:11,328 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@28472239{vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar}
              20:12:11,328 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@28472239{vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar}
              20:12:11,343 INFO [JBossASKernel] Created KernelDeployment for: MessageClient.jar
              20:12:11,343 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=Message.ear,jar=MessageClient.jar,name=MessageClient,service=EJB3
              20:12:11,343 INFO [JBossASKernel] with dependencies:
              20:12:11,343 INFO [JBossASKernel] and demands:
              20:12:11,343 INFO [JBossASKernel] and supplies:
              20:12:11,343 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=Message.ear,jar=MessageClient.jar,name=MessageClient,service=EJB3) to KernelDeployment of: MessageClient.jar
              20:12:11,375 INFO [JBossASKernel] Created KernelDeployment for: MessageEJB.jar
              20:12:11,375 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=Message.ear,jar=MessageEJB.jar,name=MessageBean,service=EJB3
              20:12:11,375 INFO [JBossASKernel] with dependencies:
              20:12:11,375 INFO [JBossASKernel] and demands:
              20:12:11,375 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
              20:12:11,375 INFO [JBossASKernel] and supplies:
              20:12:11,375 INFO [JBossASKernel] jndi:null
              20:12:11,375 INFO [JBossASKernel] Class:javax.jms.MessageListener
              20:12:11,375 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=Message.ear,jar=MessageEJB.jar,name=MessageBean,service=EJB3) to KernelDeployment of: MessageEJB.jar
              20:12:11,390 INFO [ClientENCInjectionContainer] STARTED CLIENT ENC CONTAINER: MessageClient
              20:12:11,453 INFO [EJBContainer] STARTED EJB: de.fhw.komponentenarchitekturen.knauf.mdb.MessageBean ejbName: MessageBean
              20:12:11,468 WARN [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@d150b(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@15a5ab destination=queue/MessageBeanQueue destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
              javax.naming.NameNotFoundException: MessageBeanQueue not bound
               at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
               at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
               at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
               at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
               at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
               at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713)
               at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:673)
               at javax.naming.InitialContext.lookup(Unknown Source)
               at org.jboss.util.naming.Util.lookup(Util.java:222)
               at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDestination(JmsActivation.java:464)
               at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:352)
               at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:729)
               at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
               at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
               at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
               at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
               at java.lang.Thread.run(Unknown Source)
              20:12:11,515 INFO [QueueService] Queue[queue/MessageBeanQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000


              The corresponding snippets from server.log are:
              2009-01-27 20:12:11,265 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] (HDScanner) Scheduling deployment: vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear parent=null
              2009-01-27 20:12:11,265 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] (HDScanner) Scheduling deployment: vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageClient.jar parent=AbstractVFSDeploymentContext@19588921{vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear}
              2009-01-27 20:12:11,265 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] (HDScanner) Scheduling deployment: vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar parent=AbstractVFSDeploymentContext@19588921{vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear}
              2009-01-27 20:12:11,265 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] (HDScanner) Scheduling deployment: vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar/knaufmq-service.xml parent=AbstractVFSDeploymentContext@28472239{vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar}
              2009-01-27 20:12:11,265 DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] (HDScanner) Deploying vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear
              2009-01-27 20:12:11,265 WARN [org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext] (HDScanner) Unable to register deployment mbean vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar/knaufmq-service.xml
              javax.management.InstanceAlreadyExistsException: jboss.deployment:id="vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar/knaufmq-service.xml",type=SubDeployment already registered.
               at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
              


              and
              2009-01-27 20:12:11,468 DEBUG [org.jboss.resource.adapter.jms.inflow.JmsActivation] (WorkManager(2)-3) Setup DLQ org.jboss.resource.adapter.jms.inflow.JmsActivation@a9ed1f(spec=org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@d150b mepf=org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory@eb691 active=true dlq=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler@163a8b0 transacted=true)
              2009-01-27 20:12:11,468 DEBUG [org.jboss.resource.adapter.jms.inflow.JmsActivation] (WorkManager(2)-3) Destination type defined as javax.jms.Queue
              2009-01-27 20:12:11,468 DEBUG [org.jboss.resource.adapter.jms.inflow.JmsActivation] (WorkManager(2)-3) Retrieving destination queue/MessageBeanQueue of type javax.jms.Queue
              2009-01-27 20:12:11,468 WARN [org.jboss.resource.adapter.jms.inflow.JmsActivation] (WorkManager(2)-3) Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@d150b(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@15a5ab destination=queue/MessageBeanQueue destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
              javax.naming.NameNotFoundException: MessageBeanQueue not bound
               at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
               ...
              2009-01-27 20:12:11,468 DEBUG [org.jboss.resource.adapter.jms.inflow.JmsActivation] (WorkManager(2)-3) Tearing down org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@d150b(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@15a5ab destination=queue/MessageBeanQueue destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
              2009-01-27 20:12:11,468 DEBUG [org.jboss.resource.adapter.jms.inflow.JmsActivation] (WorkManager(2)-3) Removing DLQ org.jboss.resource.adapter.jms.inflow.JmsActivation@a9ed1f(spec=org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@d150b mepf=org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory@eb691 active=true dlq=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler@163a8b0 transacted=true)
              ...
              2009-01-27 20:12:11,515 DEBUG [org.jboss.system.ServiceController] (HDScanner) Creating service knauf:service=Queue,name=MessageBeanQueue
              2009-01-27 20:12:11,515 DEBUG [org.jboss.jms.server.destination.QueueService] (HDScanner) Creating knauf:service=Queue,name=MessageBeanQueue
              2009-01-27 20:12:11,515 DEBUG [org.jboss.jms.server.destination.QueueService] (HDScanner) Created knauf:service=Queue,name=MessageBeanQueue
              2009-01-27 20:12:11,515 DEBUG [org.jboss.system.ServiceController] (HDScanner) starting service knauf:service=Queue,name=MessageBeanQueue
              2009-01-27 20:12:11,515 DEBUG [org.jboss.jms.server.destination.QueueService] (HDScanner) Starting knauf:service=Queue,name=MessageBeanQueue
              2009-01-27 20:12:11,515 DEBUG [org.jboss.jms.server.DestinationJNDIMapper] (HDScanner) queue MessageBeanQueue registered


              But despite those exceptions, the MDB works fine.
              Seems that the exception on redeploy occurs during cleanup of the old config?

              Best regards

              Wolfgang


              • 4. Re: MDB redeploy with ...-service.xml
                jaikiran pai Master

                 

                On first deploy, this is the console output:

                20:10:29,250 WARN [AbstractDeploymentContext] Unable to register deployment mbean vfszip:/C:/temp/j
                boss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar/knaufmq-service.xml
                javax.management.InstanceAlreadyExistsException: jboss.deployment:id="vfszip:/C:/temp/jboss-5.0.0.GA/server/default/deploy/Message.ear/MessageEJB.jar/knaufmq-service.xml",type=SubDeployment already registered.
                


                If the exception is coming up on the first deployment, then i guess there's some problem. I believe, you are not deploying the same service from some other place (maybe deploy folder?)
                I see that you have placed the -service.xml at the root of the jar. How about moving it into the META-INF of the jar?

                • 5. Re: MDB redeploy with ...-service.xml
                  Wolfgang Knauf Master

                  Hi jaikiran,

                  the -service.xml in META-INF instead of the JAR root results only in this error:

                  javax.naming.NameNotFoundException: MessageBeanQueue not bound
                   at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
                   at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
                  ...
                  21:14:01,335 INFO [QueueService] Queue[queue/MessageBeanQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000


                  The first error (javax.management.InstanceAlreadyExistsException) is gone.

                  So I assume that -service.xml files MUST be placed in META-INF? Is this correct? Or is there some problem that those files are deployed twice now? My MDB sample for JBoss 4.2 worked with this file in JAR root.

                  For the "NameNotFoundException": is there some dependency of the MDB deployer to the service deployer, which is in the wrong order?

                  Thanks

                  Wolfgang

                  • 6. Re: MDB redeploy with ...-service.xml
                    jaikiran pai Master

                     

                    "Wolfgang Knauf" wrote:
                    Hi jaikiran,

                    the -service.xml in META-INF instead of the JAR root ...
                    The first error (javax.management.InstanceAlreadyExistsException) is gone.


                    As i suspected, this looks like some issue with JBossAS-5 deployment. Maybe you could open a thread in our AS5 forum to see if someone has more inputs.

                    So I assume that -service.xml files MUST be placed in META-INF? Is this correct?

                    Not sure. AS5 forum may provide an answer :) But if placing it at the root of the jar is incorrect, then atleast the deployer should not throw a AlreadyExistsException.


                    "Wolfgang Knauf" wrote:

                    results only in this error:
                    javax.naming.NameNotFoundException: MessageBeanQueue not bound
                     at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
                     at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
                    ...
                    21:14:01,335 INFO [QueueService] Queue[queue/MessageBeanQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000



                    For the "NameNotFoundException": is there some dependency of the MDB deployer to the service deployer, which is in the wrong order?

                    Thanks

                    Wolfgang


                    Yes, looks like an ordering issue. Going by the logs, you first see the error and then the successful binding of the queue. Add a @Depends on your MDB (either the annotation or through deployment descriptor jboss.xml) to prevent the MDB from deploying before the queue is deployed.


                    • 7. Re: MDB redeploy with ...-service.xml
                      Wolfgang Knauf Master

                      Hi Jaikiran,

                      many thanks for the suggestion with the @Depends annotation, the "NameNotFoundException" is gone now.

                      I modified my MDB:

                      @MessageDriven (activationConfig=
                       {
                       @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
                       @ActivationConfigProperty(propertyName="destination", propertyValue="queue/MessageBeanQueue")
                       })
                      @Depends(value = "knauf:service=Queue,name=MessageBeanQueue")
                      public class MessageBean implements MessageListener
                      {


                      On deploy, I see that it waits for my service:
                      22:49:55,640 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=Message.ear,jar=MessageEJB.jar,name=MessageBean,service=EJB3
                      22:49:55,640 INFO [JBossASKernel] with dependencies:
                      22:49:55,640 INFO [JBossASKernel] and demands:
                      22:49:55,640 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
                      22:49:55,640 INFO [JBossASKernel] knauf:service=Queue,name=MessageBeanQueue
                      22:49:55,640 INFO [JBossASKernel] and supplies:
                      22:49:55,656 INFO [JBossASKernel] jndi:null
                      22:49:55,656 INFO [JBossASKernel] Class:javax.jms.MessageListener


                      Thanks to ALRubinger for adding detailed info output of deployed beans ;-).

                      Wolfgang


                      • 8. Re: MDB redeploy with ...-service.xml
                        Wolfgang Knauf Master

                        The "InstanceAlreadyExistsException" is in the AS5 forum now: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4205691

                        Thanks

                        Wolfgang

                        • 9. Re: MDB redeploy with ...-service.xml
                          Wolfgang Knauf Master

                          Just for the records: the "InstanceAlreadyExistsException" is fixed in 5.0.1GA