0 Replies Latest reply on Jan 17, 2013 8:39 AM by anil Konduru

    problem with JMS queue monitorning using JMX

    anil Konduru Newbie



      Below is my code, trying to get JMXConnector, MBeanServerConnection, JMSQueueControl and then accessing queue counters, so that i get message counter information. But it gives me error as below.


      JMX_URL = "service:jmx:rmi:///jndi/rmi://";


      ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());

                  JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap());

                  MBeanServerConnection mbsc = connector.getMBeanServerConnection();

                  JMSQueueControl queueControl = (JMSQueueControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,




                  String counters = queueControl.listMessageCounter();

                  MessageCounterInfo messageCounter = MessageCounterInfo.fromJSON(counters);


      java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: jmxrmi

          at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)



      It work when i use jmxrmiconnect instead, but that seems to be not right. The example i tried is from hornetQ examples jms/message-counters, but that doesn't work.


      appreciate any help.