1 Reply Latest reply on Apr 8, 2010 9:11 AM by mariqn nenchev

    Queue not deployed after replicating on new nodeHi,  I have a class that implements MessageListener, and it also holds the queue object that it listens on. I will not go into details but on single node every thing works perfect. But when i added second no

    mariqn nenchev Novice

      Hi,  I have a class that implements MessageListener, and it also holds the queue object that it listens on. I will not go into details but on single node every thing works perfect. But when i added second node there were some problems with the queue. I needed this object to be accessible across the cluster and i added it into jboss cache. In the other node the queue is initialized (because it was replicated), but actually the queue was never deployed on the node and i got JMSEXception:

        • 1. a
          mariqn nenchev Novice

          2010-04-07 16:49:24,345 ERROR [org.jboss.messaging.util.ExceptionUtil] (Thread-39) SessionEndpoint[de-sby37q7g-1-r74x6q7g-7818wf-53o4c5] send [oe-xey37q7g-1-r74x6q7g-7818wf-53o4c5] javax.jms.JMSException: Failed to route Reference[20818299524628488]:RELIABLE to ef-lcrp6q7g-1-unzm6q7g-w3ytb5-100j3      at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.sendMessage(ServerConnectionEndpoint.java:757)      at org.jboss.jms.server.endpoint.ServerSessionEndpoint.send(ServerSessionEndpoint.java:399)      at org.jboss.jms.server.endpoint.advised.SessionAdvised.org$jboss$jms$server$endpoint$advised$SessionAdvised$send$aop(SessionAdvised.java:87)      at org.jboss.jms.server.endpoint.advised.SessionAdvised$send_7280680627620114891.invokeTarget(SessionAdvised$send_7280680627620114891.java)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)      at org.jboss.jms.server.container.SecurityAspect.handleSend(SecurityAspect.java:157)      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)      at java.lang.reflect.Method.invoke(Method.java:597)      at org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:122)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)      at org.jboss.jms.server.endpoint.advised.SessionAdvised.send(SessionAdvised.java)      at org.jboss.jms.wireformat.SessionSendRequest.serverInvoke(SessionSendRequest.java:95)      at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:143)      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)      at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)      at org.jboss.remoting.Client.invoke(Client.java:1724)      at org.jboss.remoting.Client.invoke(Client.java:629)      at org.jboss.remoting.Client.invoke(Client.java:617)      at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:189)      at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:160)      at org.jboss.jms.client.delegate.ClientSessionDelegate.org$jboss$jms$client$delegate$ClientSessionDelegate$send$aop(ClientSessionDelegate.java:499)      at org.jboss.jms.client.delegate.ClientSessionDelegate$send_6145266547759487588.invokeTarget(ClientSessionDelegate$send_6145266547759487588.java)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)      at org.jboss.jms.client.container.SessionAspect.handleSend(SessionAspect.java:661)      at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect_z_handleSend_20574010.invoke(SessionAspect_z_handleSend_20574010.java)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)      at org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:92)      at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)      at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)      at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)      at org.jboss.jms.client.delegate.ClientSessionDelegate.send(ClientSessionDelegate.java)      at org.jboss.jms.client.container.ProducerAspect.handleSend(ProducerAspect.java:269)      at org.jboss.aop.advice.org.jboss.jms.client.container.ProducerAspect_z_handleSend_20574010.invoke(ProducerAspect_z_handleSend_20574010.java)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)      at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)      at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)      at org.jboss.jms.client.delegate.ClientProducerDelegate.send(ClientProducerDelegate.java)      at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:164)      at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:207)      at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:145)      at org.jboss.jms.client.JBossMessageProducer.send(JBossMessageProducer.java:136)      at claire.ejb.logic.data.beans.QueueSenderBean.sendToQueue(QueueSenderBean.java:83)      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)      at java.lang.reflect.Method.invoke(Method.java:597)      at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)      at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)      at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)      at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)      at sun.reflect.GeneratedMethodAccessor457.invoke(Unknown Source)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)      at java.lang.reflect.Method.invoke(Method.java:597)      at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)      at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)      at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_20574010.invoke(InvocationContextInterceptor_z_fillMethod_20574010.java)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)      at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)      at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_20574010.invoke(InvocationContextInterceptor_z_setup_20574010.java)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)      at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)      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.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)      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.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176)      at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216)      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 $Proxy407.sendToQueue(Unknown Source)  So in order to fix this in the send method i catch JMSException, try to initialize the queue and resend the message. Every thing works. But is this the right approach? Here is what i changed:  QueueSender qs = queueSession.createSender(pqm.getQueue());  try { qs.send(msg); } catch (final JMSException e) {                     // deploy the queue                     objectThatHoldsTheQueue.startQueue(getQFactory()); qs = queueSession.createSender(pqm.getQueue());                     // resend the message                      qs.send(msg);