1 Reply Latest reply on Feb 8, 2006 12:57 PM by alimnemonic

    Failed to get JMS Queue

    mawione

      Hi,

      I'm trying to get hold of JBoss JMS queue from my MBean. It works fine when I "hot-deploy" my MBean when JBoss is allready started, but fails when I start JBoss with my MBean deployed. I get following exception:

      Failed to get JMS Queue. Exception = javax.naming.NameNotFoundException: ConnectionFactory not bound

      The code get the queue looks like this:

      private void getJMSQueue() {
       try {
       InitialContext iniCtx = new InitialContext();
       Object tmp = iniCtx.lookup("ConnectionFactory");
       QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
       conn = qcf.createQueueConnection();
       que = (Queue) iniCtx.lookup("queue/testQueue");
       session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
       conn.start();
       } catch (Exception e) {
       System.out.println("Failed to get JMS Queue. Exception = " + e.toString());
       return;
       }
       System.out.println("GeneralMessageManager() Got JMS queue!!");
       }
      


      This is how my jboss-service.xml looks like:


      <server>
       <mbean code="com.ascom.communication.jmx.ServerSocket" name="Ascom:service=ServerSocket,jndiName=ascom/communication/terminal">
       <attribute name="JndiName">ascom/communication/terminal</attribute>
       <depends>jboss:service=Naming</depends>
       <depends>jboss.jms:alias=QueueConnectionFactory</depends>
       </mbean>
      </server>
      

      What am I doing wrong?
      Thanks for your reply!

      /Magnus