Results 1 to 3 of 3

Thread: MBeanProxyFactoryBean problem with invoke method get*()

  1. #1
    Join Date
    Oct 2011
    Posts
    2

    Default 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. #2

    Default

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

    Thanks!

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

  3. #3
    Join Date
    Oct 2011
    Posts
    2

    Default

    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
    ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •