3 Replies Latest reply on Nov 20, 2001 4:15 AM by pra

    Destination does not exist while creating it?

    jbaker_softcomms

      I get JMS application error in my client when trying to create a queue to receive user messages. The server gives me another. It seems to make no sense to me as obviously the destination doesn't exist as I am trying to create it. Maybe I have missed something obvious.
      Please help me, I am not used to using JBossMQ...

      ----- Server output ----

      [OILServerILService] Client request resulted in a server exception:
      javax.jms.JMSException: This destination does not exist !
      at org.jboss.mq.server.JMSServer.createQueue(JMSServer.java:437)
      at org.jboss.mq.il.oil.OILServerILService.run(OILServerILService.java:238)
      at java.lang.Thread.run(Unknown Source)

      --- client output ----

      org.jboss.mq.SpyJMSException: Cannot get the Queue from the provider
      at org.jboss.mq.SpyConnection.createQueue(SpyConnection.java:179)
      at org.jboss.mq.SpyQueueSession.createQueue(SpyQueueSession.java:82)
      at
      com.katalyzt.toolbox.ext.msg.gui.MessagingAidExtension.initMessaging(Messagi
      ngAidExtension.java:181)
      at
      com.katalyzt.toolbox.ext.msg.gui.MessagingAidExtension.openAid(MessagingAidE
      xtension.java:92)
      at
      com.katalyzt.toolbox.gui.ToolboxSessionPanel.registerAidExtension(ToolboxSes
      sionPanel.java:321)
      at
      com.katalyzt.toolbox.ext.msg.gui.MessagingInitializer.preInitialize(Messagin
      gInitializer.java:26)
      at
      com.katalyzt.toolbox.gui.DefaultExtensionLoader.loadExtensions(DefaultExtens
      ionLoader.java:117)
      at
      com.katalyzt.toolbox.gui.ToolboxSessionPanel$3.run(ToolboxSessionPanel.java:
      105)
      at com.katalyzt.toolbox.task.TaskQueueImpl.runTask(TaskQueueImpl.java:237)
      at com.katalyzt.toolbox.task.TaskQueueImpl.runTask(TaskQueueImpl.java:244)
      at com.katalyzt.toolbox.task.TaskQueueImpl.run(TaskQueueImpl.java:200)
      at java.lang.Thread.run(Thread.java:484)

      linked exception is:

      javax.jms.JMSException: This destination does not exist !

      --- Client code attempting to create a queue with name based on current user id ---

      void initMessaging()
      {
      try
      {
      // Connect to the messaging service
      namingContext = new InitialContext();

      // Setup p2p messaging queue to receive any messages sent to current user
      QueueConnectionFactory factory = (QueueConnectionFactory)namingContext.lookup(QUEUE_CONNECTION_FACTORY);
      QueueConnection connection = factory.createQueueConnection();
      connection.start();
      QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
      session.setMessageListener(this);

      // Create queue to allow other to send me messages
      String userId = TModelSessionProxy.singleton().getUser().getUserName();
      Queue queue = session.createQueue(MESSAGE_P2P_ROOT + userId);
      }
      catch (Exception x)
      {
      getAidExtensionContext().getToolboxSession().getMessageManager().setError(x);
      }
      }

        • 1. Re: Destination does not exist while creating it?
          dim

          At

          Queue queue = session.createQueue(MESSAGE_P2P_ROOT + userId
          


          you are not actually "creating" the queue, rather a reference to it. The JMS API does not provide a vendor neutral way of creating queues. They are "administered objects" from memory, and everything regarding creation/management is done in a vendor-specific way. In this case, you create them using the JMS interface (I think), or in jboss.jcml.

          hth
          dim

          • 2. Re: Destination does not exist while creating it?
            jbaker_softcomms

            Damn!!!... This must be a feature request then... The previous implementation I was using would create one if it didn't exist this way!!.. Oww.. How do you do this with JBossMQ right now? I can abstract out the creation stuff... The idea here is that a user logged in creates a queue and other users know if the user is around and can receive messages by the existance of the queue... Pretty simple stuff really... But I need dynamic queue creation...

            • 3. Re: Destination does not exist while creating it?

              It's covered in the manual.

              //Peter