You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Narita Bagchi <Na...@headstrong.com> on 2012/04/26 10:05:13 UTC

javax.management.AttributeNotFoundException

Hi,

I am at Camel 2.9.0. I am able to view the MBean data for running processes in JConsole.

I need to display the same in our user interface. While I try to fetch the attribute values, I get the following error. Note - Attribute "EndpointUri" is fetching the right value. Problem is with "FirstExchangeCompletionTime". So I am concluding that there might not be any possible problem revolving the server connection. When we were at Camel.1.6.4, the same line of code for the attribute "FirstExchangeCompletedTimestamp" used to work fine. Had there been any change in JMX set up after Camel 1.6.4?

We are using the following properties for our JMX setup -
Dorg.apache.camel.jmx.disabled=false -Dorg.apache.camel.jmx.rmiConnector.registryPort=2001


Error -
javax.management.AttributeNotFoundException: getAttribute failed: ModelMBeanAttributeInfo not found for FirstExchangeCompletionTime
        at javax.management.modelmbean.RequiredModelMBean.getAttribute(RequiredModelMBean.java:1326)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:666)
        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 java.security.AccessController.doPrivileged(Native Method)
        at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1367)
        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:662)
        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)

Please help.
Thanks.
Narita


***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***

RE: javax.management.AttributeNotFoundException

Posted by Narita Bagchi <Na...@headstrong.com>.
We are fetching the values through MBeanServerConnection::getAttribute("X") method. I went through the Camel source code where these attributes are obtained through  org.apache.camel.management.mbean.Statistic.

I tried (non-static way) -
MBeanServerConnection::getAttribute("org.apache.camel.firstExchangeCompletedTimestamp")
MBeanServerConnection::getAttribute("firstExchangeCompletedTimestamp")

But none seems to be working.

Narita
________________________________________
From: Claus Ibsen [claus.ibsen@gmail.com]
Sent: Thursday, April 26, 2012 2:31 PM
To: users@camel.apache.org
Subject: Re: javax.management.AttributeNotFoundException

Hi

Yeah Camel 1.x and 2.x has changed.

The API for JMX is now in javadoc, and you can see the attributes here
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/api/management/mbean/ManagedPerformanceCounterMBean.html

from this package
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/api/management/mbean/package-frame.html


On Thu, Apr 26, 2012 at 10:05 AM, Narita Bagchi
<Na...@headstrong.com> wrote:
> Hi,
>
> I am at Camel 2.9.0. I am able to view the MBean data for running processes in JConsole.
>
> I need to display the same in our user interface. While I try to fetch the attribute values, I get the following error. Note - Attribute "EndpointUri" is fetching the right value. Problem is with "FirstExchangeCompletionTime". So I am concluding that there might not be any possible problem revolving the server connection. When we were at Camel.1.6.4, the same line of code for the attribute "FirstExchangeCompletedTimestamp" used to work fine. Had there been any change in JMX set up after Camel 1.6.4?
>
> We are using the following properties for our JMX setup -
> Dorg.apache.camel.jmx.disabled=false -Dorg.apache.camel.jmx.rmiConnector.registryPort=2001
>
>
> Error -
> javax.management.AttributeNotFoundException: getAttribute failed: ModelMBeanAttributeInfo not found for FirstExchangeCompletionTime
>        at javax.management.modelmbean.RequiredModelMBean.getAttribute(RequiredModelMBean.java:1326)
>        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:666)
>        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 java.security.AccessController.doPrivileged(Native Method)
>        at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1367)
>        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:662)
>        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)
>
> Please help.
> Thanks.
> Narita
>
>
> ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***



--
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***

Re: javax.management.AttributeNotFoundException

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah Camel 1.x and 2.x has changed.

The API for JMX is now in javadoc, and you can see the attributes here
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/api/management/mbean/ManagedPerformanceCounterMBean.html

from this package
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/api/management/mbean/package-frame.html


On Thu, Apr 26, 2012 at 10:05 AM, Narita Bagchi
<Na...@headstrong.com> wrote:
> Hi,
>
> I am at Camel 2.9.0. I am able to view the MBean data for running processes in JConsole.
>
> I need to display the same in our user interface. While I try to fetch the attribute values, I get the following error. Note - Attribute "EndpointUri" is fetching the right value. Problem is with "FirstExchangeCompletionTime". So I am concluding that there might not be any possible problem revolving the server connection. When we were at Camel.1.6.4, the same line of code for the attribute "FirstExchangeCompletedTimestamp" used to work fine. Had there been any change in JMX set up after Camel 1.6.4?
>
> We are using the following properties for our JMX setup -
> Dorg.apache.camel.jmx.disabled=false -Dorg.apache.camel.jmx.rmiConnector.registryPort=2001
>
>
> Error -
> javax.management.AttributeNotFoundException: getAttribute failed: ModelMBeanAttributeInfo not found for FirstExchangeCompletionTime
>        at javax.management.modelmbean.RequiredModelMBean.getAttribute(RequiredModelMBean.java:1326)
>        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:666)
>        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 java.security.AccessController.doPrivileged(Native Method)
>        at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1367)
>        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:662)
>        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)
>
> Please help.
> Thanks.
> Narita
>
>
> ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.***



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/