4 Replies Latest reply: Mar 6, 2012 12:54 PM by sloke RSS

Undeploy issue with Java messaging

sachin.garg Newbie

Hi,

 

I have deployed a message queue on JBOSS AS 5.1.0. The queue has been created programtically invoking an operation on ServerPeer MBean using 2 parameters: queueName and JNDI name.

The queue gets created perfectly and works fine. But when I stop JBOSS (using shutdown hooks), the serverPeer MBean gets undeployed before my code. As a result I am not able to undeploy the message queue (by invoking serverPeer MBean) and get some exception (pasted below). I believe that either some sort of dependency injection needs to be done or I need to come up with some other mechanism to remove queue. Please suggest.

 

ERROR [STDERR] javax.management.InstanceNotFoundException: jboss.messaging:service=ServerPeer is not registered.

ERROR [STDERR]     at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:526)

ERROR [STDERR]     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:662)

ERROR [STDERR]     at a.b.c.d.destroyMessageQueue(ResourceAdaptor.java:590)

ERROR [STDERR]     at a.b.c.d.raInactive(ResourceAdaptor.java:191)

ERROR [STDERR]     at org.mobicents.slee.resource.ResourceAdaptorObjectImpl.raInactive(ResourceAdaptorObjectImpl.java:297)

ERROR [STDERR]     at org.mobicents.slee.resource.ResourceAdaptorEntityImpl.allActivitiesEnded(ResourceAdaptorEntityImpl.java:332)

ERROR [STDERR]     at org.mobicents.slee.resource.ResourceAdaptorEntityImpl.scheduleAllActivitiesEnd(ResourceAdaptorEntityImpl.java:437)

ERROR [STDERR]     at org.mobicents.slee.resource.ResourceAdaptorEntityImpl.sleeStopping(ResourceAdaptorEntityImpl.java:318)

ERROR [STDERR]     at org.mobicents.slee.container.management.ResourceManagementImpl.sleeStopping(ResourceManagementImpl.java:1083)

ERROR [STDERR]     at org.mobicents.slee.container.SleeContainer$1.run(SleeContainer.java:643)

ERROR [STDERR]     at org.mobicents.slee.container.SleeContainer.setSleeState(SleeContainer.java:659)

ERROR [STDERR]     at org.mobicents.slee.container.management.jmx.SleeManagementMBeanImpl.stop(SleeManagementMBeanImpl.java:289)

ERROR [STDERR]     at org.mobicents.slee.container.management.jmx.SleeManagementMBeanImpl.stopSlee(SleeManagementMBeanImpl.java:654)

ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)

ERROR [STDERR]     at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)

ERROR [STDERR]     at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)

ERROR [STDERR]     at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)

ERROR [STDERR]     at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)

ERROR [STDERR]     at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)

ERROR [STDERR]     at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)

ERROR [STDERR]     at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)

ERROR [STDERR]     at org.jboss.kernel.plugins.dependency.LifecycleAction.uninstallActionInternal(LifecycleAction.java:249)

ERROR [STDERR]     at org.jboss.kernel.plugins.dependency.InstallsAwareAction.uninstallAction(InstallsAwareAction.java:157)

ERROR [STDERR]     at org.jboss.kernel.plugins.dependency.InstallsAwareAction.uninstallAction(InstallsAwareAction.java:42)

ERROR [STDERR]     at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleUninstallAction(SimpleControllerContextAction.java:79)

ERROR [STDERR]     at org.jboss.dependency.plugins.action.AccessControllerContextAction.uninstall(AccessControllerContextAction.java:131)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContextActions.uninstall(AbstractControllerContextActions.java:58)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:354)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:1664)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1275)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:827)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

ERROR [STDERR]     at org.jboss.system.ServiceController.doChange(ServiceController.java:688)

ERROR [STDERR]     at org.jboss.system.ServiceController.stop(ServiceController.java:510)

ERROR [STDERR]     at org.jboss.system.microcontainer.jmx.ServiceControllerStartStopLifecycleCallback.uninstall(ServiceControllerStartStopLifecycleCallback.java:52)

ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)

ERROR [STDERR]     at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)

ERROR [STDERR]     at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)

ERROR [STDERR]     at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)

ERROR [STDERR]     at org.jboss.beans.info.plugins.AbstractBeanInfo.invoke(AbstractBeanInfo.java:300)

ERROR [STDERR]     at org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext.invoke(AbstractKernelControllerContext.java:286)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractLifecycleCallbackItem.uninstall(AbstractLifecycleCallbackItem.java:112)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.handleLifecycleCallbacks(AbstractController.java:1570)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.handleUninstallLifecycleCallbacks(AbstractController.java:1546)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1273)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:655)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:568)

ERROR [STDERR]     at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.undeploy(BeanMetaDataDeployer.java:153)

ERROR [STDERR]     at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.undeploy(BeanMetaDataDeployer.java:51)

ERROR [STDERR]     at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalUndeploy(AbstractSimpleRealDeployer.java:69)

ERROR [STDERR]     at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.undeploy(AbstractRealDeployer.java:112)

ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployerWrapper.undeploy(DeployerWrapper.java:196)

ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doUndeploy(DeployersImpl.java:1469)

ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doUninstallParentLast(DeployersImpl.java:1376)

ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doUninstallParentLast(DeployersImpl.java:1369)

ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.uninstall(DeployersImpl.java:1331)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:354)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:1664)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1275)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:827)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:694)

ERROR [STDERR]     at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679)

ERROR [STDERR]     at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

ERROR [STDERR]     at org.jboss.system.server.profileservice.repository.ProfileDeployAction.uninstall(ProfileDeployAction.java:95)

ERROR [STDERR]     at org.jboss.system.server.profileservice.repository.AbstractProfileAction.uninstall(AbstractProfileAction.java:70)

ERROR [STDERR]     at org.jboss.system.server.profileservice.repository.AbstractProfileService.uninstall(AbstractProfileService.java:375)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:354)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:1664)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1275)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:827)

ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

ERROR [STDERR]     at org.jboss.system.server.profileservice.repository.AbstractProfileService.deactivateProfile(AbstractProfileService.java:402)

ERROR [STDERR]     at org.jboss.system.server.profileservice.ProfileServiceBootstrap.deactivateProfiles(ProfileServiceBootstrap.java:388)

ERROR [STDERR]     at org.jboss.system.server.profileservice.ProfileServiceBootstrap.shutdown(ProfileServiceBootstrap.java:345)

ERROR [STDERR]     at org.jboss.bootstrap.AbstractServerImpl.shutdownServer(AbstractServerImpl.java:571)

ERROR [STDERR]     at org.jboss.bootstrap.AbstractServerImpl$ShutdownHook.run(AbstractServerImpl.java:909)

  • 1. Re: Undeploy issue with Java messaging
    Justin Bertram Master

    This is really a life-cycle/dependency issue.  A destination that is deployed declaratively has a dependency on the ServerPeer, e.g.:

     

       <mbean code="org.jboss.jms.server.destination.QueueService"

          name="jboss.messaging.destination:service=Queue,name=DLQ"

          xmbean-dd="xmdesc/Queue-xmbean.xml">

          <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>

          <depends>jboss.messaging:service=PostOffice</depends>

       </mbean>

     

    When you create the destination programmatically there dependency doesn't exist.  However, I don't think it actually matters because when the ServerPeer shuts down I believe it will automatically clean up destinations which were created programmatically.

  • 2. Re: Undeploy issue with Java messaging
    sachin.garg Newbie

    Thanks Justin for the reply.

    But I have one query: What will happen to the pending unacknowledged messages in the queue? I don't want to loose those messages. Will the messages reappear once the JBOSS restarts?

    FYI: I am using a persistent queue.

  • 3. Re: Undeploy issue with Java messaging
    Justin Bertram Master

    I believe if the queue you create is not temporary then it will be persisted (i.e. it will survive a server restart).  Likewise, any persistent, unacknowledged messages in that queue should survive a restart as well.  Try it out and let me know if you see anything different.

  • 4. Re: Undeploy issue with Java messaging
    sloke Newbie

    Hi Justin, I have a similar need for creating Dynamic Durable Queues (Can't use a configuration file) and as Sachin suggested when the server restarts all those are being undeployed. I can see them in JBM_POSTOFFICE but they are not bound. How can I get around to this problem. Any help is greatly appreciated.

     

    Thanks

    --

    Sri