1 Reply Latest reply on Feb 18, 2004 6:23 AM by Adrian Brock

    InvalidDestinationException: This destination does not exist

    georgewinters Newbie

      I have a jboss-3.2.3 server that contains both a session bean and a MDB. I have successfully connected the MDB to a remote queue but am having troubles getting the session bean to add a message to the same queue. I know the MDB is working OK because I have a simple app that connects to the JMS queue and loads it with messages and the MDB receives the messages just fine. Here's the error I get when the session bean attempts to add to the queue:
      javax.jms.InvalidDestinationException: This destination does not exist! QUEUE.DataImportRequest

      Here's the code from the session bean:
      Context jndi = new InitialContext();
      QueueConnectionFactory factory = (QueueConnectionFactory) jndi.lookup("UIL2XAConnectionFactory");
      javax.jms.Queue requestQueue = (javax.jms.Queue) jndi.lookup("java:comp/env/queue/DataImportRequest");
      QueueConnection connection = factory.createQueueConnection();
      QueueSession session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      QueueSender sender = session.createSender(requestQueue);
      ObjectMessage msg = session.createObjectMessage();
      msg.setStringProperty("QueueEntry", queueEntryId);
      msg.setObject(new ImportRequestDto(contributor, includeNotes, size));
      sender.send(msg);
      connection.close();

      ejb-jar.xml:
      ...

      ...
      <resource-ref id="ResRef_1">
      <res-ref-name>queue/DataImportRequest</res-ref-name>
      <res-type>javax.jms.Queue</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      <resource-ref id="ResRef_2">
      <res-ref-name>UIL2XAConnectionFactory</res-ref-name>
      <res-type>javax.jms.QueueConnectionFactory</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      ...

      jboss.xml:
      ...

      ...
      <resource-ref>
      <res-ref-name>queue/DataImportRequest</res-ref-name>
      <jndi-name>jnp://10.52.30.91:1099/queue/DataImportRequest</jndi-name>
      </resource-ref>
      <resource-ref>
      <res-ref-name>UIL2XAConnectionFactory</res-ref-name>
      <jndi-name>UIL2XAConnectionFactory</jndi-name>
      </resource-ref>
      ...

      ...
      <message-driven>
      <ejb-name>DataImportMessageService</ejb-name>
      <destination-jndi-name>queue/DataImportRequest</destination-jndi-name>
      <configuration-name>Remote Queue Message Driven Bean</configuration-name>
      <resource-ref>
      <res-ref-name>UIL2XAConnectionFactory</res-ref-name>
      <jndi-name>UIL2XAConnectionFactory</jndi-name>
      </resource-ref>
      </message-driven>
      ...

      Here's the log with trace level logging on for org.jboss.mq and org.jboss.naming when I run the relevant session bean method:

      16:12:55,575 DEBUG [SpyConnectionFactoryObjectFactory] Extracting SpyConnectionFactory from reference
      16:12:55,577 DEBUG [SpyConnectionFactoryObjectFactory] The GenericConnectionFactory is: GenericConnectionFactory:[server=org.jboss.mq.il.uil2.UILServerIL@92b7c2,connectionProperties={UIL_ADDRESS_KEY=10.52.30.77, UIL_CHUNKSIZE_KEY=1000000, UIL_TCPNODELAY_KEY=yes, ClientILService=org.jboss.mq.il.uil2.UILClientILService, UIL_PORT_KEY=9093, UIL_BUFFERSIZE_KEY=2048, PingPeriod=60000}]
      16:12:55,599 DEBUG [SpyDestinationObjectFactory] SpyDestinationObjectFactory->getObjectInstance()
      16:12:55,601 DEBUG [SocketManager] Begin ReadTask.run
      16:12:55,601 DEBUG [SocketManager] Begin WriteTask.run
      16:12:55,601 DEBUG [SocketManager] Created ObjectOutputStream
      16:12:55,602 DEBUG [SocketManager] Begin ReadTask.run
      16:12:55,603 DEBUG [SocketManager] Created ObjectInputStream
      16:12:55,603 DEBUG [SocketManager] Begin WriteTask.run
      16:12:55,603 DEBUG [SocketManager] Created ObjectOutputStream
      16:12:55,610 DEBUG [SocketManager] Created ObjectInputStream
      16:12:55,611 DEBUG [GenericConnectionFactory] Handing out ClientIL: org.jboss.mq.il.uil2.UILClientILService
      16:12:55,611 DEBUG [UILClientILService] Starting
      16:12:55,612 DEBUG [ServerSocketManagerHandler] Setting up the UILClientIL Connection
      16:12:55,612 DEBUG [ServerSocketManagerHandler] The UILClientIL Connection is set up
      16:12:55,660 DEBUG [SecurityManager] No SecurityMetadadata was available for DataImportRequest using default security config
      16:12:55,665 ERROR [SocketManager] Failed to handle: org.jboss.mq.il.uil2.msgs.AddMsg22799134[msgType: m_addMessage, msgID: -2147483620, error: null]
      javax.jms.InvalidDestinationException: This destination does not exist! QUEUE.DataImportRequest
      at org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:400)
      at org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:383)
      at org.jboss.mq.server.JMSServerInterceptorSupport.addMessage(JMSServerInterceptorSupport.java:136)
      at org.jboss.mq.security.ServerSecurityInterceptor.addMessage(ServerSecurityInterceptor.java:162)
      at org.jboss.mq.server.TracingInterceptor.addMessage(TracingInterceptor.java:270)
      at org.jboss.mq.server.JMSServerInvoker.addMessage(JMSServerInvoker.java:136)
      at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:86)
      at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:355)
      at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:377)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:732)
      at java.lang.Thread.run(Thread.java:534)
      16:12:55,672 FATAL [DataImportServiceImpl] Exception from server while processing actions.
      javax.jms.InvalidDestinationException: This destination does not exist! QUEUE.DataImportRequest
      at org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:400)
      at org.jboss.mq.server.JMSDestinationManager.addMessage(JMSDestinationManager.java:383)
      at org.jboss.mq.server.JMSServerInterceptorSupport.addMessage(JMSServerInterceptorSupport.java:136)
      at org.jboss.mq.security.ServerSecurityInterceptor.addMessage(ServerSecurityInterceptor.java:162)
      at org.jboss.mq.server.TracingInterceptor.addMessage(TracingInterceptor.java:270)
      at org.jboss.mq.server.JMSServerInvoker.addMessage(JMSServerInvoker.java:136)
      at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:86)
      at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:355)
      at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:377)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:732)
      at java.lang.Thread.run(Thread.java:534)



      I could include a snippet from my jms-ds.xml and other configuration info if necessary but since the MDB works I don't think it is necessary. (Please let me know if that is incorrect.)

      I tried turning up the logging level on the remote JBoss server (the JMS server) but nothing showed up there when running my test.

      Any idea what I'm doing wrong?

      George