10 Replies Latest reply on Jul 12, 2011 11:36 AM by Shil K

    Hornetq / MDB Deployment Order Issue in AS 6

    Nick Goodman Newbie

      I have an ear file with a mdb within it (in addition to several stateless session beans).  I've discovered that when I deploy the ear file after jboss has started completely, then the mdb's ejbCreate and setMessageDrivenContext methods are invoked by the container.  When I start JBoss with the ear file already in place, however, then the mdb's ejbCreate and setMessageDrivenContext methods are never invoked and the mdb's onMessage method is never called when messages are put into the JMS queue.  Looking at the start-up output, I believe that my ear file is being deployed before the hortnetq jms server/mbeans.

       

      I've read http://community.jboss.org/message/544222?tstart=0#544222, which appears to deal with this issue in part, but I'm not sure how to force my ear to depend upon hornetq.  I've tried modifying the name of my hornetq deployment xml file, but it doesn't appear to modify the deployment order.

       

      Thus, my questions/thoughts are:

       

      1) Can I force hornetq to deploy before my ear?

       

      2) Is there a way to force my ear file to not deploy until hornetq has started

       

       

      JBoss version: jboss-6.0.0.20100721-M4

       

       

      thanks

        • 1. Re: Hornetq / MDB Deployment Order Issue in AS 6
          Nick Goodman Newbie

          I should note that when I pause my jboss server's startup at the output of "[HornetQServerImpl] live server is starting.." and then deploy the ear file, the mdb works correctly.  This is, in large part, why I think the issue is a deployment order one.

          • 2. Re: Hornetq / MDB Deployment Order Issue in AS 6
            Nick Goodman Newbie

            Nobody has any idea if it's even possible to order deployments and JMS queues in JBoss?

            • 3. Re: Hornetq / MDB Deployment Order Issue in AS 6
              Elias Ross Master

              I have a similar issue on AS4, where my EJB code looks like:

               

              @Singleton @Startup

              public class MyEJB {

                @Resource(mappedName="queue/foo")

                private Queue foo;

              }

               

              This will fail to deploy, and you will end up with errors in your log.

              • 4. Re: Hornetq / MDB Deployment Order Issue in AS 6
                jaikiran pai Master

                Elias Ross wrote:

                 

                I have a similar issue on AS4,

                You mean AS 6.0.0.M4?

                 

                I don't exactly remember for M4, but atleast the current AS trunk has some changes in this area. If a deployment (like a EJB) depends on a JMS destination and the destination hasn't yet been deployed, then the server will not throw an exception but will wait for the destination to be created.

                • 5. Re: Hornetq / MDB Deployment Order Issue in AS 6
                  Elias Ross Master

                  Actually, I'm seeing this in the latest build, where "Startup" here is an EJB singleton.

                   

                  16:39:30,113 INFO  [SubscriptionManagerStartup] Initializing subscriptions...
                  16:39:30,284 WARN  [HornetQActivation] Failure in HornetQ activation org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@1278338 destination=queue/netupdate destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15): HornetQException[errorCode=105 message=Unable to validate user: null for check type CONSUME for address jms.queue.netupdate]
                          at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:287) [:]
                          at org.hornetq.core.client.impl.ClientSessionImpl.internalCreateConsumer(ClientSessionImpl.java:1556) [:]
                          at org.hornetq.core.client.impl.ClientSessionImpl.createConsumer(ClientSessionImpl.java:447) [:]
                          at org.hornetq.core.client.impl.ClientSessionImpl.createConsumer(ClientSessionImpl.java:392) [:]
                          at org.hornetq.core.client.impl.DelegatingSession.createConsumer(DelegatingSession.java:201) [:]
                          at org.hornetq.ra.inflow.HornetQMessageHandler.setup(HornetQMessageHandler.java:165) [:]
                          at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:291) [:]
                          at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:573) [:]
                          at org.jboss.resource.work.WorkWrapper.run(WorkWrapper.java:172) [:6.0.0-SNAPSHOT]
                          at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33) [:]
                          at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:780) [:]
                          at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45) [:]
                          at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:800) [:]
                          at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]
                          at org.jboss.threads.JBossThread.run(JBossThread.java:122) [:]
                  
                  16:39:30,300 INFO  [HornetQActivation] awaiting topic/queue creation queue/event/subjoin
                  16:39:30,300 INFO  [HornetQActivation] awaiting topic/queue creation queue/event/mfcs
                  16:39:30,284 INFO  [HornetQActivation] awaiting topic/queue creation queue/event/subbatch
                  16:39:30,284 INFO  [HornetQActivation] awaiting topic/queue creation queue/event/dcm
                  16:39:30,284 INFO  [HornetQActivation] awaiting topic/queue creation queue/event/dcmmem
                  16:39:30,284 WARN  [HornetQActivation] Failure in HornetQ activation org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@1278338 destination=queue/event/mom destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15): HornetQException[errorCode=105 message=Unable to validate user: null for check type CONSUME for address jms.queue.mom]
                          at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:287) [:]
                          at org.hornetq.core.client.impl.ClientSessionImpl.internalCreateConsumer(ClientSessionImpl.java:1556) [:]
                          at org.hornetq.core.client.impl.ClientSessionImpl.createConsumer(ClientSessionImpl.java:447) [:]
                          at org.hornetq.core.client.impl.ClientSessionImpl.createConsumer(ClientSessionImpl.java:392) [:]
                          at org.hornetq.core.client.impl.DelegatingSession.createConsumer(DelegatingSession.java:201) [:]
                          at org.hornetq.ra.inflow.HornetQMessageHandler.setup(HornetQMessageHandler.java:165) [:]
                          at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:291) [:]
                          at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:573) [:]
                          at org.jboss.resource.work.WorkWrapper.run(WorkWrapper.java:172) [:6.0.0-SNAPSHOT]
                          at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33) [:]
                          at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:780) [:]
                          at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45) [:]
                          at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:800) [:]
                          at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]
                          at org.jboss.threads.JBossThread.run(JBossThread.java:122) [:]
                  
                  <<< repeats >>>>
                  
                  
                  16:39:30,331 INFO  [PropertyAccessEJB] postConstruct()
                  16:39:30,736 WARN  [AbstractKernelController] Broken callback: ClassSingleCallbackItem@8e3f75{name=interface org.jboss.ejb3.container.spi.EJBContainer whenRequired=ControllerState@710087{Installed} dependentState=ControllerState@710087{Installed} attributeName=onInstall owner=AbstractKernelControllerContext@17c67f9{ metadata=AbstractBeanMetaData@1feae0f{name=StartupSingletonInitiator bean=org.jboss.ejb3.singleton.deployer.StartupSingletonInitiator properties= classLoader=BeanMetaDataDeployer$DeploymentClassLoaderMetaData@130dd8e{classloader=null} constructor=null autowireCandidate=true installCallbacks=[method=onInstall]}name=StartupSingletonInitiator target=org.jboss.ejb3.singleton.deployer.StartupSingletonInitiator@13ef890 state=Installed depends=AbstractDependencyInfo@121c77b{}} signature=org.jboss.ejb3.container.spi.EJBContainer}: java.lang.RuntimeException: Could not invoke PostConstruct on the newly created bean instance
                          at org.jboss.ejb3.singleton.impl.container.SingletonEJBInstanceManagerImpl.create(SingletonEJBInstanceManagerImpl.java:136) [:1.0.0-alpha-14]
                          at org.jboss.ejb3.singleton.deployer.StartupSingletonInitiator.onInstall(StartupSingletonInitiator.java:67) [:1.0.0-alpha-14]
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_21]
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_21]
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_21]
                          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_21]
                          at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.0.Alpha9]
                          at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.0.Alpha9]
                          at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.0.Alpha9]
                          at org.jboss.beans.info.plugins.AbstractBeanInfo.invoke(AbstractBeanInfo.java:300) [jboss-reflect.jar:2.2.0.Alpha9]
                          at org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext.invoke(AbstractKernelControllerContext.java:305) [jboss-kernel.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.SingleCallbackItem.changeCallback(SingleCallbackItem.java:67) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractCallbackItem.changeCallback(AbstractCallbackItem.java:80) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.OwnerCallbackItem.changeCallback(OwnerCallbackItem.java:116) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.resolveCallbacks(AbstractController.java:1951) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1092) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:894) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:182) [:2.2.0.Alpha7]
                          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.Alpha7]
                          at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.Alpha7]
                          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.Alpha7]
                          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.Alpha7]
                          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.Alpha7]
                          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.Alpha7]
                          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) [:2.2.0.Alpha7]
                          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.0.Alpha7]
                          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.Alpha7]
                          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.Alpha10]
                          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.Alpha10]
                  
                  Caused by: java.lang.RuntimeException: java.lang.RuntimeException: javax.ejb.EJBException: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.autodesk.lbs.afx.subscriptionmanager.SubscriptionManagerEJB/subbatch into property com.autodesk.lbs.afx.subscriptionmanager.SubscriptionManagerEJB.subbatch: queue not bound
                          at org.jboss.ejb3.interceptors.container.AbstractContainer.invokeCallback(AbstractContainer.java:262) [:1.0.8]
                          at org.jboss.ejb3.EJBContainer.invokeCallback(EJBContainer.java:1300) [:1.5.2]
                          at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1311) [:1.5.2]
                          at org.jboss.ejb3.singleton.aop.impl.AOPBasedSingletonContainer.postConstruct(AOPBasedSingletonContainer.java:734) [:1.0.0-alpha-14]
                          at org.jboss.ejb3.singleton.impl.container.SingletonEJBInstanceManagerImpl.create(SingletonEJBInstanceManagerImpl.java:132) [:1.0.0-alpha-14]
                          ... 68 more
                  Caused by: java.lang.RuntimeException: javax.ejb.EJBException: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.autodesk.lbs.afx.subscriptionmanager.SubscriptionManagerEJB/subbatch into property com.autodesk.lbs.afx.subscriptionmanager.SubscriptionManagerEJB.subbatch: queue not bound
                          at com.autodesk.lbs.afx.subscriptionmanager.SubscriptionManagerStartup.configureService(SubscriptionManagerStartup.java:97) [:]
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_21]
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_21]
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_21]
                          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_21]
                          at org.jboss.ejb3.interceptors.aop.LifecycleCallbackBeanMethodInterceptor.invoke(LifecycleCallbackBeanMethodInterceptor.java:69) [:1.0.8]
                          at org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:80) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47) [:1.5.2]
                          at org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:80) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88) [:1.0.8]
                          at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_13512112.invoke(InvocationContextInterceptor_z_setup_13512112.java) [:]
                          at org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:80) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67) [:1.0.1]
                          at org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:80) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.ejb3.interceptors.container.AbstractContainer.invokeCallback(AbstractContainer.java:258) [:1.0.8]
                          ... 72 more
                  Caused by: javax.ejb.EJBException: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.autodesk.lbs.afx.subscriptionmanager.SubscriptionManagerEJB/subbatch into property com.autodesk.lbs.afx.subscriptionmanager.SubscriptionManagerEJB.subbatch: queue not bound
                          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:183) [:0.0.1]
                          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:251) [:0.0.1]
                          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349) [:0.0.1]
                          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209) [:0.0.1]
                          at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52) [:0.0.1]
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) [:1.0.0.GA]
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) [:1.0.3]
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182) [:1.5.2]
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41) [:1.5.2]
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67) [:1.5.2]
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47) [:1.5.2]
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67) [:1.0.1]
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86) [:1.5.2]
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:369) [:1.5.2]
                          at org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:88) [:1.5.2]
                          at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:75) [:1.5.2]
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62) [:1.0.1.GA]
                          at $Proxy201.invoke(Unknown Source)     at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185) [:1.0.11-alpha-2]
                          at $Proxy200.startupUpdateSubscriptions(Unknown Source) at com.autodesk.lbs.afx.subscriptionmanager.SubscriptionManagerStartup.configureService(SubscriptionManagerStartup.java:95) [:]
                          ... 86 more
                  Caused by: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.autodesk.lbs.afx.subscriptionmanager.SubscriptionManagerEJB/subbatch into property com.autodesk.lbs.afx.subscriptionmanager.SubscriptionManagerEJB.subbatch: queue not bound
                          at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:82) [:1.5.2]
                          at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:99) [:1.5.2]
                          at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:89) [:1.5.2]
                          at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:61) [:1.5.2]
                          at org.jboss.ejb3.injection.InjectionHelper.inject(InjectionHelper.java:51) [:1.5.2]
                          at org.jboss.ejb3.injection.InjectionHelper.inject(InjectionHelper.java:43) [:1.5.2]
                          at org.jboss.ejb3.session.SessionInjectionInvocation.proceed(SessionInjectionInvocation.java:45) [:1.5.2]
                          at org.jboss.ejb3.injection.InjectionInvocation.invokeTarget(InjectionInvocation.java:97) [:1.5.2]
                          at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvocation.java:91) [:1.5.2]
                          at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47) [:1.5.2]
                          at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvocation.java:82) [:1.5.2]
                          at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67) [:1.0.1]
                          at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvocation.java:82) [:1.5.2]
                          at org.jboss.ejb3.EJBContainer.injectBeanContext(EJBContainer.java:1278) [:1.5.2]
                          at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:85) [:1.5.2]
                          at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:62) [:1.5.2]
                          at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:57) [:1.5.2]
                          at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:54) [:1.5.2]
                          at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:86) [:1.5.2]
                          at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58) [:1.5.2]
                          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.Alpha3]
                          at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:90) [:1.5.2]
                          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247) [:0.0.1]
                          ... 115 more
                  Caused by: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: queue not bound]
                          at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1356) [:5.0.5.Final]
                          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:819) [:5.0.5.Final]
                          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688) [:5.0.5.Final]
                          at sun.reflect.GeneratedMethodAccessor293.invoke(Unknown Source) [:1.6.0_21]
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_21]
                          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_21]
                          at org.jboss.ejb3.EJBContainer$1.invoke(EJBContainer.java:877) [:1.5.2]
                          at $Proxy150.lookup(Unknown Source)     at org.jboss.ejb3.JndiUtil.lookup(JndiUtil.java:44) [:1.5.2]
                          at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:75) [:1.5.2]
                          ... 137 more
                  Caused by: javax.naming.NameNotFoundException: queue not bound
                          at org.jnp.server.NamingServer.getBinding(NamingServer.java:771) [:5.0.5.Final]
                          at org.jnp.server.NamingServer.getBinding(NamingServer.java:779) [:5.0.5.Final]
                          at org.jnp.server.NamingServer.getObject(NamingServer.java:785) [:5.0.5.Final]
                          at org.jnp.server.NamingServer.lookup(NamingServer.java:396) [:5.0.5.Final]
                          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728) [:5.0.5.Final]
                          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688) [:5.0.5.Final]
                          at javax.naming.InitialContext.lookup(InitialContext.java:392) [:1.6.0_21]
                          at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1350) [:5.0.5.Final]
                          ... 146 more
                  
                  

                   

                  So it seems like there's still an issue. It does attempt to wait, but a half second later aborts...

                  • 6. Re: Hornetq / MDB Deployment Order Issue in AS 6
                    jaikiran pai Master

                    Technically, the "wait" is only for MDBs. So if you have a MDB which listens on a queue/topic, then the MDB will not fail if the queue/topic is deployed after the MDB.

                     

                    In your case, you are having a @Startup @Singleton bean which is injecting a queue. I guess like below:

                     

                    @Singleton
                    @Startup
                    public class SubscriptionManagerEJB
                    {
                    
                        @Resource (mappedName="queue/event/subbatch")
                        private Queue subbatch;
                        ...
                    }
                    

                     

                    In this case, the singelton startup will not wait for the queue. You will have to specify an explicit dependency in the Singleton as follows (assuming "subbatch" is the "name" of your queue):

                        
                    @org.jboss.ejb3.annotation.Depends("org.hornetq:module=JMS,name=\"subbatch\",type=Queue")
                    @Singleton
                    @Startup
                    public class SubscriptionManagerEJB
                    {
                    ...
                    
                    • 7. Re: Hornetq / MDB Deployment Order Issue in AS 6
                      Elias Ross Master

                      Is this going to be fixed? It's possible for me to add this annotation, but I wonder if MDBs are now fixed, then why not EJBs as well? I'll give it a go and report back.

                      • 8. Re: Hornetq / MDB Deployment Order Issue in AS 6
                        Elias Ross Master

                        Thanks, that seemed to do the trick. It's not elegant, but it works.

                        • 9. Re: Hornetq / MDB Deployment Order Issue in AS 6
                          jaikiran pai Master

                          Elias Ross wrote:

                           

                          Is this going to be fixed? It's possible for me to add this annotation, but I wonder if MDBs are now fixed, then why not EJBs as well?

                          For MDBs it's slightly different since the queue/topic is a target destination of the MDB. However injection of queue/topics or other resources in EJBs are handled differently. And currently, there's no implicit dependency added. The injection support in AS6 is being worked out and this implicit dependency might be added.

                          • 10. Re: Hornetq / MDB Deployment Order Issue in AS 6
                            Shil K Newbie

                            Hi Jai,

                             

                            I am facing the same issue. I have mentioned the queue names in hornetq-jms.xml and in the ejb code I have given the

                            following :

                            @

                            org.jboss.ejb3.annotation.Depends("org.hornetq:module=JMS,name=\queueName\",type=Queue"

                             

                            But still after deployment I get an error saying the

                             

                            Caused by: javax.naming.NameNotFoundException: queueName 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 sun.reflect.GeneratedMethodAccessor392.invoke(Unknown Source)
                                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                at java.lang.reflect.Method.invoke(Method.java:597)
                                at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
                                at sun.rmi.transport.Transport$1.run(Transport.java:159)
                                at java.security.AccessController.doPrivileged(Native Method)
                                at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
                                at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
                                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
                                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
                                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:619)
                                at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
                                at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
                                at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
                                at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
                                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
                                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
                                at javax.naming.InitialContext.lookup(InitialContext.java:392)

                            Could you please help? I am not able to understand where did I go wrong? Appreciate anyones help

                             

                            Thanks,