Announcement Announcement Module
Collapse
No announcement yet.
MBeanProxyFactoryBean problem with invoke method get*() Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 :-)

  • #2
    Hi, did you ever get an answer to this problem? I am experiencing something similar.

    Thanks!

    Originally posted by scoro View Post
    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 :-)

    Comment


    • #3
      Hi,

      I have never got an answer to that :/

      Try to follow my suggestions how to make it works (if possible of course):
      ...
      The problem disappears after:
      a) method name change
      b) change annotation from @ManagedOperation to @ManagedAttribute
      ...

      Comment

      Working...
      X