Back Forum Reply New

My JMX beans no longer work in RC2?

I'm using the MBeanExporter in combination with jdk 1.5 annotations (via the MetadataMBeanInfoAssembler and AnnotationJmxAttributeSource classes). Things were working fine in RC1, but with RC2 one of my MBeans works, but the rest produce an exception whenever I try to invoke an operation on them (see stack trace below - the key message seems to be quot;java.lang.IllegalArgumentException: object is not an instance of declaring classquot;).

I'm at a bit of a loss to explain why.  There is no obvious difference between the mbean that works and the ones that don't, except that they are exported by different MBeanExporters (although they are both set up in the same way).  Any ideas what might be causing this?Thanks,
CharlesCode:
java.lang.reflect.UndeclaredThrowableException
at $Proxy9.invoke#40;Unknown Source#41;
at org.mc4j.console.bean.operation.OperationExecutionResultsVisualPanel$2.run#40;OperationExecutionResultsVisualPanel.java#58;126#41;
at java.lang.Thread.run#40;Thread.java#58;595#41;
Caused by#58; java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0#40;Native Method#41;
at sun.reflect.NativeMethodAccessorImpl.invoke#40;NativeMethodAccessorImpl.java#58;39#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at org.mc4j.console.connection.proxy.JMXRemotingMBeanServerProxy.invoke#40;JMXRemotingMBeanServerProxy.java#58;61#41;
... 3 more
Caused by#58; javax.management.RuntimeOperationsException#58; RuntimeException occured in RequiredModelMBean while trying to invoke operation retrieveScheduledTasksAsString
at javax.management.modelmbean.RequiredModelMBean.invokeMethod#40;RequiredModelMBean.java#58;1076#41;
at javax.management.modelmbean.RequiredModelMBean.invoke#40;RequiredModelMBean.java#58;952#41;
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke#40;DynamicMetaDataImpl.java#58;213#41;
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke#40;MetaDataImpl.java#58;220#41;
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke#40;DefaultMBeanServerInterceptor.java#58;815#41;
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke#40;JmxMBeanServer.java#58;784#41;
at com.sun.jmx.remote.security.MBeanServerAccessController.invoke#40;MBeanServerAccessController.java#58;429#41;
at javax.management.remote.rmi.RMIConnectionImpl.doOperation#40;RMIConnectionImpl.java#58;1408#41;
at javax.management.remote.rmi.RMIConnectionImpl.access$100#40;RMIConnectionImpl.java#58;81#41;
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run#40;RMIConnectionImpl.java#58;1245#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation#40;RMIConnectionImpl.java#58;1348#41;
at javax.management.remote.rmi.RMIConnectionImpl.invoke#40;RMIConnectionImpl.java#58;782#41;
at sun.reflect.GeneratedMethodAccessor155.invoke#40;Unknown Source#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at sun.rmi.server.UnicastServerRef.dispatch#40;UnicastServerRef.java#58;294#41;
at sun.rmi.transport.Transport$1.run#40;Transport.java#58;153#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at sun.rmi.transport.Transport.serviceCall#40;Transport.java#58;149#41;
at sun.rmi.transport.tcp.TCPTransport.handleMessages#40;TCPTransport.java#58;460#41;
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run#40;TCPTransport.java#58;701#41;
at java.lang.Thread.run#40;Thread.java#58;595#41;
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer#40;StreamRemoteCall.java#58;247#41;
at sun.rmi.transport.StreamRemoteCall.executeCall#40;StreamRemoteCall.java#58;223#41;
at sun.rmi.server.UnicastRef.invoke#40;UnicastRef.java#58;126#41;
at com.sun.jmx.remote.internal.PRef.invoke#40;Unknown Source#41;
at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke#40;Unknown Source#41;
at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke#40;RMIConnector.java#58;969#41;
... 8 more
Caused by#58; java.lang.IllegalArgumentException#58; object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0#40;Native Method#41;
at sun.reflect.NativeMethodAccessorImpl.invoke#40;NativeMethodAccessorImpl.java#58;39#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at javax.management.modelmbean.RequiredModelMBean.invokeMethod#40;RequiredModelMBean.java#58;1070#41;
at javax.management.modelmbean.RequiredModelMBean.invoke#40;RequiredModelMBean.java#58;952#41;
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke#40;DynamicMetaDataImpl.java#58;213#41;
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke#40;MetaDataImpl.java#58;220#41;
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke#40;DefaultMBeanServerInterceptor.java#58;815#41;
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke#40;JmxMBeanServer.java#58;784#41;
at com.sun.jmx.remote.security.MBeanServerAccessController.invoke#40;MBeanServerAccessController.java#58;429#41;
at javax.management.remote.rmi.RMIConnectionImpl.doOperation#40;RMIConnectionImpl.java#58;1408#41;
at javax.management.remote.rmi.RMIConnectionImpl.access$100#40;RMIConnectionImpl.java#58;81#41;
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run#40;RMIConnectionImpl.java#58;1245#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation#40;RMIConnectionImpl.java#58;1348#41;
at javax.management.remote.rmi.RMIConnectionImpl.invoke#40;RMIConnectionImpl.java#58;782#41;
at sun.reflect.GeneratedMethodAccessor155.invoke#40;Unknown Source#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at sun.rmi.server.UnicastServerRef.dispatch#40;UnicastServerRef.java#58;294#41;
at sun.rmi.transport.Transport$1.run#40;Transport.java#58;153#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at sun.rmi.transport.Transport.serviceCall#40;Transport.java#58;149#41;
at sun.rmi.transport.tcp.TCPTransport.handleMessages#40;TCPTransport.java#58;460#41;
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run#40;TCPTransport.java#58;701#41;
... 1 more
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0#40;Native Method#41;
at sun.reflect.NativeMethodAccessorImpl.invoke#40;NativeMethodAccessorImpl.java#58;39#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at org.mc4j.console.connection.proxy.JMXRemotingMBeanServerProxy.invoke#40;JMXRemotingMBeanServerProxy.java#58;61#41;
at $Proxy9.invoke#40;Unknown Source#41;
at org.mc4j.console.bean.operation.OperationExecutionResultsVisualPanel$2.run#40;OperationExecutionResultsVisualPanel.java#58;126#41;
at java.lang.Thread.run#40;Thread.java#58;595#41;
Caused by#58; javax.management.RuntimeOperationsException#58; RuntimeException occured in RequiredModelMBean while trying to invoke operation retrieveScheduledTasksAsString
at javax.management.modelmbean.RequiredModelMBean.invokeMethod#40;RequiredModelMBean.java#58;1076#41;
at javax.management.modelmbean.RequiredModelMBean.invoke#40;RequiredModelMBean.java#58;952#41;
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke#40;DynamicMetaDataImpl.java#58;213#41;
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke#40;MetaDataImpl.java#58;220#41;
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke#40;DefaultMBeanServerInterceptor.java#58;815#41;
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke#40;JmxMBeanServer.java#58;784#41;
at com.sun.jmx.remote.security.MBeanServerAccessController.invoke#40;MBeanServerAccessController.java#58;429#41;
at javax.management.remote.rmi.RMIConnectionImpl.doOperation#40;RMIConnectionImpl.java#58;1408#41;
at javax.management.remote.rmi.RMIConnectionImpl.access$100#40;RMIConnectionImpl.java#58;81#41;
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run#40;RMIConnectionImpl.java#58;1245#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation#40;RMIConnectionImpl.java#58;1348#41;
at javax.management.remote.rmi.RMIConnectionImpl.invoke#40;RMIConnectionImpl.java#58;782#41;
at sun.reflect.GeneratedMethodAccessor155.invoke#40;Unknown Source#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at sun.rmi.server.UnicastServerRef.dispatch#40;UnicastServerRef.java#58;294#41;
at sun.rmi.transport.Transport$1.run#40;Transport.java#58;153#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at sun.rmi.transport.Transport.serviceCall#40;Transport.java#58;149#41;
at sun.rmi.transport.tcp.TCPTransport.handleMessages#40;TCPTransport.java#58;460#41;
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run#40;TCPTransport.java#58;701#41;
at java.lang.Thread.run#40;Thread.java#58;595#41;
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer#40;StreamRemoteCall.java#58;247#41;
at sun.rmi.transport.StreamRemoteCall.executeCall#40;StreamRemoteCall.java#58;223#41;
at sun.rmi.server.UnicastRef.invoke#40;UnicastRef.java#58;126#41;
at com.sun.jmx.remote.internal.PRef.invoke#40;Unknown Source#41;
at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke#40;Unknown Source#41;
at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke#40;RMIConnector.java#58;969#41;
... 8 more
Caused by#58; java.lang.IllegalArgumentException#58; object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0#40;Native Method#41;
at sun.reflect.NativeMethodAccessorImpl.invoke#40;NativeMethodAccessorImpl.java#58;39#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at javax.management.modelmbean.RequiredModelMBean.invokeMethod#40;RequiredModelMBean.java#58;1070#41;
at javax.management.modelmbean.RequiredModelMBean.invoke#40;RequiredModelMBean.java#58;952#41;
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke#40;DynamicMetaDataImpl.java#58;213#41;
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke#40;MetaDataImpl.java#58;220#41;
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke#40;DefaultMBeanServerInterceptor.java#58;815#41;
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke#40;JmxMBeanServer.java#58;784#41;
at com.sun.jmx.remote.security.MBeanServerAccessController.invoke#40;MBeanServerAccessController.java#58;429#41;
at javax.management.remote.rmi.RMIConnectionImpl.doOperation#40;RMIConnectionImpl.java#58;1408#41;
at javax.management.remote.rmi.RMIConnectionImpl.access$100#40;RMIConnectionImpl.java#58;81#41;
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run#40;RMIConnectionImpl.java#58;1245#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation#40;RMIConnectionImpl.java#58;1348#41;
at javax.management.remote.rmi.RMIConnectionImpl.invoke#40;RMIConnectionImpl.java#58;782#41;
at sun.reflect.GeneratedMethodAccessor155.invoke#40;Unknown Source#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at sun.rmi.server.UnicastServerRef.dispatch#40;UnicastServerRef.java#58;294#41;
at sun.rmi.transport.Transport$1.run#40;Transport.java#58;153#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at sun.rmi.transport.Transport.serviceCall#40;Transport.java#58;149#41;
at sun.rmi.transport.tcp.TCPTransport.handleMessages#40;TCPTransport.java#58;460#41;
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run#40;TCPTransport.java#58;701#41;
... 1 more
javax.management.RuntimeOperationsException#58; RuntimeException occured in RequiredModelMBean while trying to invoke operation retrieveScheduledTasksAsString
at javax.management.modelmbean.RequiredModelMBean.invokeMethod#40;RequiredModelMBean.java#58;1076#41;
at javax.management.modelmbean.RequiredModelMBean.invoke#40;RequiredModelMBean.java#58;952#41;
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke#40;DynamicMetaDataImpl.java#58;213#41;
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke#40;MetaDataImpl.java#58;220#41;
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke#40;DefaultMBeanServerInterceptor.java#58;815#41;
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke#40;JmxMBeanServer.java#58;784#41;
at com.sun.jmx.remote.security.MBeanServerAccessController.invoke#40;MBeanServerAccessController.java#58;429#41;
at javax.management.remote.rmi.RMIConnectionImpl.doOperation#40;RMIConnectionImpl.java#58;1408#41;
at javax.management.remote.rmi.RMIConnectionImpl.access$100#40;RMIConnectionImpl.java#58;81#41;
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run#40;RMIConnectionImpl.java#58;1245#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation#40;RMIConnectionImpl.java#58;1348#41;
at javax.management.remote.rmi.RMIConnectionImpl.invoke#40;RMIConnectionImpl.java#58;782#41;
at sun.reflect.GeneratedMethodAccessor155.invoke#40;Unknown Source#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at sun.rmi.server.UnicastServerRef.dispatch#40;UnicastServerRef.java#58;294#41;
at sun.rmi.transport.Transport$1.run#40;Transport.java#58;153#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at sun.rmi.transport.Transport.serviceCall#40;Transport.java#58;149#41;
at sun.rmi.transport.tcp.TCPTransport.handleMessages#40;TCPTransport.java#58;460#41;
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run#40;TCPTransport.java#58;701#41;
at java.lang.Thread.run#40;Thread.java#58;595#41;
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer#40;StreamRemoteCall.java#58;247#41;
at sun.rmi.transport.StreamRemoteCall.executeCall#40;StreamRemoteCall.java#58;223#41;
at sun.rmi.server.UnicastRef.invoke#40;UnicastRef.java#58;126#41;
at com.sun.jmx.remote.internal.PRef.invoke#40;Unknown Source#41;
at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke#40;Unknown Source#41;
at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke#40;RMIConnector.java#58;969#41;
at sun.reflect.NativeMethodAccessorImpl.invoke0#40;Native Method#41;
at sun.reflect.NativeMethodAccessorImpl.invoke#40;NativeMethodAccessorImpl.java#58;39#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at org.mc4j.console.connection.proxy.JMXRemotingMBeanServerProxy.invoke#40;JMXRemotingMBeanServerProxy.java#58;61#41;
at $Proxy9.invoke#40;Unknown Source#41;
at org.mc4j.console.bean.operation.OperationExecutionResultsVisualPanel$2.run#40;OperationExecutionResultsVisualPanel.java#58;126#41;
at java.lang.Thread.run#40;Thread.java#58;595#41;
Caused by#58; java.lang.IllegalArgumentException#58; object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0#40;Native Method#41;
at sun.reflect.NativeMethodAccessorImpl.invoke#40;NativeMethodAccessorImpl.java#58;39#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at javax.management.modelmbean.RequiredModelMBean.invokeMethod#40;RequiredModelMBean.java#58;1070#41;
at javax.management.modelmbean.RequiredModelMBean.invoke#40;RequiredModelMBean.java#58;952#41;
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke#40;DynamicMetaDataImpl.java#58;213#41;
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke#40;MetaDataImpl.java#58;220#41;
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke#40;DefaultMBeanServerInterceptor.java#58;815#41;
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke#40;JmxMBeanServer.java#58;784#41;
at com.sun.jmx.remote.security.MBeanServerAccessController.invoke#40;MBeanServerAccessController.java#58;429#41;
at javax.management.remote.rmi.RMIConnectionImpl.doOperation#40;RMIConnectionImpl.java#58;1408#41;
at javax.management.remote.rmi.RMIConnectionImpl.access$100#40;RMIConnectionImpl.java#58;81#41;
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run#40;RMIConnectionImpl.java#58;1245#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation#40;RMIConnectionImpl.java#58;1348#41;
at javax.management.remote.rmi.RMIConnectionImpl.invoke#40;RMIConnectionImpl.java#58;782#41;
at sun.reflect.GeneratedMethodAccessor155.invoke#40;Unknown Source#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at sun.rmi.server.UnicastServerRef.dispatch#40;UnicastServerRef.java#58;294#41;
at sun.rmi.transport.Transport$1.run#40;Transport.java#58;153#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at sun.rmi.transport.Transport.serviceCall#40;Transport.java#58;149#41;
at sun.rmi.transport.tcp.TCPTransport.handleMessages#40;TCPTransport.java#58;460#41;
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run#40;TCPTransport.java#58;701#41;
... 1 more
java.lang.IllegalArgumentException#58; object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0#40;Native Method#41;
at sun.reflect.NativeMethodAccessorImpl.invoke#40;NativeMethodAccessorImpl.java#58;39#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at javax.management.modelmbean.RequiredModelMBean.invokeMethod#40;RequiredModelMBean.java#58;1070#41;
at javax.management.modelmbean.RequiredModelMBean.invoke#40;RequiredModelMBean.java#58;952#41;
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke#40;DynamicMetaDataImpl.java#58;213#41;
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke#40;MetaDataImpl.java#58;220#41;
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke#40;DefaultMBeanServerInterceptor.java#58;815#41;
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke#40;JmxMBeanServer.java#58;784#41;
at com.sun.jmx.remote.security.MBeanServerAccessController.invoke#40;MBeanServerAccessController.java#58;429#41;
at javax.management.remote.rmi.RMIConnectionImpl.doOperation#40;RMIConnectionImpl.java#58;1408#41;
at javax.management.remote.rmi.RMIConnectionImpl.access$100#40;RMIConnectionImpl.java#58;81#41;
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run#40;RMIConnectionImpl.java#58;1245#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation#40;RMIConnectionImpl.java#58;1348#41;
at javax.management.remote.rmi.RMIConnectionImpl.invoke#40;RMIConnectionImpl.java#58;782#41;
at sun.reflect.GeneratedMethodAccessor155.invoke#40;Unknown Source#41;
at sun.reflect.DelegatingMethodAccessorImpl.invoke#40;DelegatingMethodAccessorImpl.java#58;25#41;
at java.lang.reflect.Method.invoke#40;Method.java#58;585#41;
at sun.rmi.server.UnicastServerRef.dispatch#40;UnicastServerRef.java#58;294#41;
at sun.rmi.transport.Transport$1.run#40;Transport.java#58;153#41;
at java.security.AccessController.doPrivileged#40;Native Method#41;
at sun.rmi.transport.Transport.serviceCall#40;Transport.java#58;149#41;
at sun.rmi.transport.tcp.TCPTransport.handleMessages#40;TCPTransport.java#58;460#41;
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run#40;TCPTransport.java#58;701#41;
at java.lang.Thread.run#40;Thread.java#58;595#41;Do you have multiple Spring versions on your classpath - that can often cause confusion similar to this.

Rob

Hi Rob,

I've found the problem.  The mbeans that don't work also have @Transactional annotations on them.  If I remove these @Transactional annotations things work fine.  For example, this works:Code:
@ManagedOperation#40;description = quot;Does somethingquot;#41;
public void doSomething#40;#41;
#123;
#125;
But this doesn't:Code:
@Transactional
@ManagedOperation#40;description = quot;Does somethingquot;#41;
public void doSomething#40;#41;
#123;
#125;

Cheers,
Charles

MMM, very interesting. I'll raise a bug for this and do some further investigation.

Thanks

Rob

Charles,

We committed some fairly substantial updates the to the handling on proxies and JMX today. Can you try your code again with a new snapshot. It might take until tomorrow for our code to sync across to the public CVS.

Rob

Hi Rob,

Thanks for the fixes, sorry I've not been able to test them sooner. I've just given it a go with build 259 (2005-05-03).  Things work fine if I use the SimpleReflectiveMBeanInfoAssembler.  However as soon as I switch to the MetadataMBeanInfoAssembler (primed with an AnnotationJmxAttributeSource) I get the following error when the mbeans with @Transactional annotations are being exported:

org..beans.factory.BeanCreationExce  ption: Error creating bean with name 'jmxExporter' defined in class path resource [qtripjmx.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: MetadataMBeanInfoAssembler does not support JDK dynamic proxies - export the target beans directly or use CGLIB proxies instead

From the error message I assume I've bumped into a limitation of JMX implementation, but I have no idea how to resolve it.  How do I go about using CGLIB proxies instead of JDK dynamic proxies for my transactional classes?

Funny thing is though, this stuff works in RC1.

Cheers,
Charles

This was a restriction we introduced recently - mainly because the semantics of JDK proxies when using annotations are very strange and in most cases undesirable.

To switch to a CGLIB proxy, simply set the proxyTargetClass property of your ProxyFactoryBean to true. This can be done as part of your configuration.

Rob

Fair enough.  I'm not actually using ProxyFactoryBean though - I'm using the DefaultAdvisorAutoProxyCreator.  I discovered that you can set proxyTargetClass on the DefaultAdvisorAutoProxyCreator as well, but I tried this and it doesn't work!  It creates a CGLIB proxy sure enough, but none of my methods actually get intercepted.  Heres my config setup:Code:   lt;bean id=quot;autoProxyCreatorquot; class=quot;org..aop.framework.autoproxy.DefaultAdvisorAutoProxyCreatorquot;gt;       lt;property name=quot;proxyTargetClassquot; value=quot;truequot;/gt;   lt;/beangt;
   lt;bean id=quot;transactionManagerquot; class=quot;org..orm.hibernate.HibernateTransactionManagerquot;gt;       lt;property name=quot;sessionFactoryquot; ref=quot;sessionFactoryquot;/gt;   lt;/beangt;

lt;bean id=quot;transactionAttributeSourcequot; class=quot;org..transaction.annotation.AnnotationTransactionAttributeSourcequot;/gt;
   lt;bean id=quot;transactionInterceptorquot; class=quot;org..transaction.interceptor.TransactionInterceptorquot;gt;       lt;property name=quot;transactionManagerquot; ref=quot;transactionManagerquot;/gt;       lt;property name=quot;transactionAttributeSourcequot; ref=quot;transactionAttributeSourcequot;/gt;   lt;/beangt;
   lt;bean id=quot;transactionAdvisorquot;       class=quot;org..transaction.interceptor.TransactionAttributeSourceAdvisorquot;gt;       lt;constructor-arggt;lt;ref bean=quot;transactionInterceptorquot; /gt;       lt;/constructor-arggt;   lt;/beangt;

And an extract from the log file:Code:
lt;DefaultAdvisorAutoProxyCreatorgt; lt;Candidate advisor #91;org..transaction.interceptor.TransactionAttributeSourceAdvisor@848ecc#93; accepted for class #91;com.eb2.qtrip.main.service.admin.DbAdminImpl#93;gt;
lt;DefaultAdvisorAutoProxyCreatorgt; lt;Creating implicit proxy for bean 'dbAdmin' with 0 common interceptors and 1 specific interceptorsgt;
lt;CollectionFactorygt; lt;Creating java.util.IdentityHashMapgt;
lt;Cglib2AopProxygt; lt;Creating CGLIB2 proxy for #91;com.eb2.qtrip.main.service.admin.DbAdminImpl#93;gt;
lt;Cglib2AopProxygt; lt;Method public void com.eb2.qtrip.main.service.admin.DbAdminImpl.loadTestData#40;#41; has return type that ensures this cannot be returned- using DISPATCH_TARGETgt;
The loadTestData method is annotated by @Transaction, but the Cglib2AopProxy class sets it up with a DISPATCH_TARGET callback, which according to the comments is quot;used for unadvised calls to static targets that cannot return thisquot;.  This doesn't seem quite right.

Any ideas what's going on here?

Cheers,
Charles

OK, I think I've found what's going on here.  I had my @Transaction annotation on the Interface method declaration, not the implementation.  This works using JDK proxies, but not CGLIB proxies.  For example, the following works if you use JDK proxies (proxyTargetClass=false) but not CGLIB (proxyTargetClass=true)Code:
public inteface Foo #123;   @Transactional   public void doSomething#40;#41; #123; #125;
#125;

public class FooImpl implements Foo #123;   public void doSomething#40;#41; #123; #125;
#125;

Maybe this is intentional, but it caught me by surprise.

Cheers,
Charles

(After a long delay...)

I can't seem to find any jira issue for this. Shall I file one, or is this something that is just gonna quot;be that wayquot;?

We had the same problem with jmx in the early 1.2 RCs, and code like
   AopProxyUtils.getTargetClass(managedBean)

was put in to fix things. But it doesn't look so straight forward in the TransactionAttributeSourceAdvisor.
¥
Back Forum Reply New