0 Replies Latest reply on Aug 2, 2010 3:57 AM by Joydeep Sarkar

    Problem with queue dependancy injection into session bean

    Joydeep Sarkar Newbie

      Hi,

       

      I am facing a problem while I am trying to inject a queue into a session bean.

       

      Following is the code snippet,

       

      @Stateless
      @RemoteBinding(jndiBinding = "remote/MQManagerBean")
      public class MQManagerBean implements MQManager
      {
              @Resource(mappedName = "java:/JmsNonXA")
              private ConnectionFactory connectionFactory;
              @Resource(mappedName = "queue/indexRequestQueue")
              Queue inQueue;
      

       

      Stacktrace

       

      imagenet.system.util.UnexpectedException: An unexpected error occurred. The System Administrators have been notified. The message is: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.getty.mms.mq.MQManagerBean/inQueue into property com.getty.mms.mq.MQManagerBean.inQueue: indexRequestQueue not bound; nested exception is: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.getty.mms.mq.MQManagerBean/inQueue into property com.getty.mms.mq.MQManagerBean.inQueue: indexRequestQueue not bound
              at imagenet.system.util.UnexpectedException.getImagenetException(UnexpectedException.java:65)
              at imagenet.system.util.ImagenetException.getImagenetException(ImagenetException.java:143)
              at imagenet.system.util.ImagenetException.getImagenetException(ImagenetException.java:123)
              at imagenet.web.util.ErrorsTag.appendErrorsElement(ErrorsTag.java:112)
              at imagenet.web.util.XmlTransformTag.doEndTag(XmlTransformTag.java:177)
              at _web_2d_inf._errors._errorPage._jspService(_errorPage.java:152)
              at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
              at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:348)
              at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:498)
              at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:402)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
              at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:293)
              at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:602)
              at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:308)
              at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:211)
              at com.evermind.server.http.EvermindHttpServletResponse.handleException(EvermindHttpServletResponse.java:1671)
              at com.evermind.server.http.EvermindHttpServletResponse.handleException(EvermindHttpServletResponse.java:1563)
              at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:792)
              at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:264)
              at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
              at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
              at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.ejb.EJBException: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.getty.mms.mq.MQManagerBean/inQueue into property com.getty.mms.mq.MQManagerBean.inQueue: indexRequestQueue not bound; nested exception is: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.getty.mms.mq.MQManagerBean/inQueue into property com.getty.mms.mq.MQManagerBean.inQueue: indexRequestQueue not bound
              at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)
              at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
              at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:421)
              at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
              at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
              at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
              at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
              at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)
              at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)
              at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)
              at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)
      Caused by: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.getty.mms.mq.MQManagerBean/inQueue into property com.getty.mms.mq.MQManagerBean.inQueue: indexRequestQueue not bound
              at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:82)
              at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:99)
              at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:89)
              at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:61)
              at org.jboss.ejb3.injection.InjectionInvocation.invokeTarget(InjectionInvocation.java:89)
              at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvocation.java:83)
              at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
              at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvocation.java:74)
              at org.jboss.ejb3.EJBContainer.injectBeanContext(EJBContainer.java:1086)
              at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:83)
              at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:56)
              at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:51)
              at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:53)
              at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:93)
              at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
              at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:421)
              at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
              at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
              at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
              at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
              at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)
              at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)
              at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)
              at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)
              at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:211)
              at org.jboss.remoting.Client.invoke(Client.java:1724)
              at org.jboss.remoting.Client.invoke(Client.java:629)
              at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
              at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
              at $Proxy3.invoke(Unknown Source)
              at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
              at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
              at $Proxy2.submitIndexRequest(Unknown Source)
              at com.gettyimages.mq.MMMQPublisher.publishMessage(MMMQPublisher.java:29)
              at imagenet.business.metadata.editor.impl.MdBundleImpl.commit(MdBundleImpl.java:370)
              at imagenet.web.functions.metadata.editor.MdEditAction.performAction(MdEditAction.java:155)
              at imagenet.web.util.LoginRequiredAction.performActionWithChecks(LoginRequiredAction.java:257)
              at imagenet.web.util.LoginRequiredAction.performExecute(LoginRequiredAction.java:77)
              at imagenet.web.util.ActionForwardFactory.getActionForward(ActionForwardFactory.java:29)
              at imagenet.web.util.BasicAction.execute(BasicAction.java:100)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
              at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:760
      

       

      hornetq-jms.xml

       

         <queue name="IndexRequestQueue">
            <entry name="/queue/indexRequestQueue"/>
         </queue>
      

       

       

      When I try to lookup the queue using JNDI properties I get no exceptions. That really means that the queue is deployed. Even the JMX console also shows the queue.

      When I try to inject the queue into the bean I get the above mentioned exception.

      Could anyone please tell me what is required to be done to have it working properly?

      I am using JBoss 5.1.0.GA and HornetQ 2.0.

       

      TIA,

      Joydeep