2 Replies Latest reply on Aug 31, 2003 11:57 PM by anithavs

    creating queue via mbean

    Arrow Newbie


      I am trying to create the queues though the mbean but facing a problem when trying to do so.

      Here is the code

      try {
      InitialContext iniCtx = new InitialContext();

      RMIAdaptor server = (RMIAdaptor) iniCtx.lookup("jmx/rmi/RMIAdaptor");

      ObjectName name = new ObjectName("jboss.mq:service=DestinationManager");

      server.invoke( name, "createQueue", new Object[] { queueName,queueName }, new String[] {String.class.getName(),String.class.getName()});

      boolean done = false;
      Object tmp;

      tmp = iniCtx.lookup("ConnectionFactory");
      System.err.println("Found ConnectionFactory!");
      QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
      conn = qcf.createQueueConnection();
      queue = (Queue) iniCtx.lookup("queue/requestq");
      session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      catch (Exception e){
      System.err.println("Exception Caught! " + e);
      throw e;


      Whenever the jboss trys to load this mbean in the start up it gives up exception saying "ConnectionFactory not bound" but the interesting part is that once the jboss is up and running if I do the hot deploy mbean works perfectly.

      Jboss-service.xml looks like


      I would appreciate any help