3 Replies Latest reply on Jun 5, 2006 2:39 PM by barrys52

    Problem creating queues dynamically

    barrys52

      Please help!

      I am using JBoss Messaging 1.0.1.CR2 and need to create/deploy queues dynamically. (That is, the queue should not be defined in the destinations-service.xml config file).

      The QueueExample that came with JBoss Messaging seems to demonstrate how to do this (in the deployQueue method of Util.java). The QueueExample runs perfectly when the queue is defined in advance. Trying to create a queue dynamically first requires getting a handle to the MBeanServerConnection object, using the lookupMBeanServerProxy() method:

      InitialContext ic = new InitialContext();
       MBeanServerConnection p =
       (MBeanServerConnection)ic.lookup("jmx/invoker/RMIAdaptor");
      
      
      However, this lookup call results in the following exception:

      javax.naming.CommunicationException [Root exception is
      java.lang.ClassNotFoundException: org.jboss.jmx.adaptor.rmi.RMIAdaptor
      (no security manager: RMI class loader disabled)]
      at
      org.jnp.interfaces.NamingContext.lookup(NamingContext.java:729)
      at
      org.jnp.interfaces.NamingContext.lookup(NamingContext.java:588)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      ...

      ============================================
      I would appreciate it if someone could explain how to correct this or provide an alternative way to dynamically create/deploy/undeploy queues.

      Thanks,
      Barry