1 Reply Latest reply on Nov 27, 2007 7:37 AM by Norbert Lotter

    How do I check if the lookup of the MBeanServerConnection wo

    Norbert Lotter Newbie

      I have installed JBoss 4.2.1 GA and JBoss Messaging 1.4.0 SP1 on a Windows XP System.

      When I try to execute the deployQueue-Method from the example utility, an exception is thrown which is caused by

      java.lang.IllegalArgumentException: Unable to find operation createQueue(java.lang.String,java.lang.String)
       ... 43 more
      

      Here is the source code that causes the error (which is exactly the code from the example files):

      public static void deployQueue(String jndiName, InitialContext ic) throws Exception {
       MBeanServerConnection mBeanServer = lookupMBeanServerProxy(ic);
      
       ObjectName serverObjectName = new ObjectName("jboss.messaging:service=ServerPeer");
      
       String queueName = jndiName.substring(jndiName.lastIndexOf('/') + 1);
      
       mBeanServer.invoke(serverObjectName, "createQueue", new Object[] { queueName, jndiName },
       new String[] { "java.lang.String", "java.lang.String" });
      
       System.out.println("Queue " + jndiName + " deployed");
       }
      
      


      The operation that fails is mBeanServerServer.invoke(...). It looks like something in my Eclipse execution environment is still not configured correctly. How do I check if the reference to the MBeanServer object is filled correctly?

        • 1. Re: How do I check if the lookup of the MBeanServerConnectio
          Norbert Lotter Newbie

          It looks as if the example code to deploy a queue ist broken. I changed the call to the ServerPeer method as follows:

          original: mBeanServer.invoke(serverObjectName, "createQueue", new Object[] { queueName, jndiName },
           new String[] { "java.lang.String", "java.lang.String" });
          
          new: mBeanServer.invoke(serverObjectName, "deployQueue", new Object[] { queueName, jndiName },
           new String[] { "java.lang.String", "java.lang.String" });
          
          


          Now the code works and creates the queues as expected.

          P.S. sorry for the misspelled headline