NullPointerException while invoking browse operation on a queue through JMX using the java code
Issue
- Developed a bundle to monitor our broker, we want to browse a queue with the following code:
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
CompositeData[] messages = (CompositeData[]) server.invoke(queue, "browse", null, null);
- When we execute this code in the bundle, we get:
java.lang.NullPointerException
at org.apache.activemq.broker.jmx.AnnotatedMBean.invoke(AnnotatedMBean.java:197)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)[:1.8.0_121]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)[:1.8.0_121]
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:298)[:1.8.0_121]
at com.sun.proxy.$Proxy48.browse(Unknown Source)
Environment
- Red Hat JBoss AMQ
- 6.2.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
