Hi, We are attempting to monitor various components in our Camel web application deployed in Tomcat. We are using spring so we enabled JMX by adding the following element to the camelContext.
<camel:jmxAgent id="jmxAgent" createConnector="true"/> We are able to connect using JConsole and browse the components without an issue. However when we try to access the components using some standalone JMX client code we are running into some difficulty. For instance, in JConsole the object name for the component we want to monitor is as follows. org.apache.camel:context=work-laptop/camelContext,type=consumers,name=FileConsumer(0x2c65b) However it can't seem to find the object name as we get the following exception. javax.management.InstanceNotFoundException: org.apache.camel:context=work-laptop/camelContext,type=consumers,name=FileConsumer(0x2c65b) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1094) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:662) at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:638) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1404) at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360) at javax.management.remote.rmi.RMIConnectionImpl.getAttribute(RMIConnectionImpl.java:600) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305) at sun.rmi.transport.Transport$1.run(Transport.java:159) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:155) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142) at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl_Stub.getAttribute(Unknown Source) at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.getAttribute(RMIConnector.java:878) at ch.syabru.nagios.NagiosJmxPlugin.query(NagiosJmxPlugin.java:322) at ch.syabru.nagios.NagiosJmxPlugin.execute(NagiosJmxPlugin.java:416) ... 1 more >From the past experiences with JMX we are probably missing some subtle syntax for the object name, but can't for the life of us figure it out. Please help us from our madness! -Jonathan -- View this message in context: http://camel.465427.n5.nabble.com/Monitoring-Camel-with-JMX-tp5646538p5646538.html Sent from the Camel - Users mailing list archive at Nabble.com.