0 Replies Latest reply on Feb 6, 2006 12:43 AM by Magnus Wistrom

    Failed to get JMS queue

    Magnus Wistrom Newbie


      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);
       } catch (Exception e) {
       System.out.println("Failed to get JMS Queue. Exception = " + e.toString());
       System.out.println("GeneralMessageManager() Got JMS queue!!");

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

       <mbean code="com.ascom.communication.jmx.ServerSocket" name="Ascom:service=ServerSocket,jndiName=ascom/communication/terminal">
       <attribute name="JndiName">ascom/communication/terminal</attribute>

      What am I doing wrong?
      Thanks for your reply!