MBeanProxyFactoryBean problem with invoke method get*()
Hi,
I met a problem while using MBeanProxyFactoryBean. The issue is that it can not invoke methods from remote objects if their names starts with get and have got no arguments.
I have expossed a method:
Code:
@ManagedAttribute
public List<Object> getUsers() throws RuntimeException
Every time I try to invoke it through the spring jmx proxy interface the following exception occurs:
Code:
Exception in thread "main" org.springframework.jmx.access.InvalidInvocationException: getAttribute failed: ModelMBeanAttributeInfo not found for Users
at org.springframework.jmx.access.MBeanClientInterceptor.doInvoke(MBeanClientInterceptor.java:445)
at org.springframework.jmx.access.MBeanClientInterceptor.invoke(MBeanClientInterceptor.java:353)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy2.getRegisterContents(Unknown Source)
...
The problem disappears after:
a) method name change
b) change annotation from @ManagedOperation to @ManagedAttribute
Both solutions are not satisfied for me cause that method is used by native JMX client yet (it works fine with this signature and annotation) and that method is neither getter nor setter so @ManagedAttribute will be rather hack than a solution.
Can you advice me how to deal with it?
Thanks for answers in advance :-)