7 Replies Latest reply on Nov 16, 2004 8:06 PM by Amanda Ge

    exposing jmx mbeans to remote clients

    dengyuan Newbie

      Hi,

      I use the JBoss 3.2.5, I followed the code in JMX FAQ's 'Exposing JMX MBeans to Remote Clients' and I have the invoke method since it's 3.2.6 and above.

      It seems work,0 except when the invoke method been invoked, the MarshalledInvocation object doesn't have method defined which is null. Can anyone tell me what did I do wrong ?

      TIA, DengYuang

        • 1. Re: exposing jmx mbeans to remote clients
          Alexey Loubyansky Master

          Could you try 3.2.6?
          In earlier versions it's trickier... You'll have to write some intermediate code that would set methodMap (see MarshalledInvocation) on the invocation object.
          In later versions that's transparent.

          • 2. Re: exposing jmx mbeans to remote clients
            dengyuan Newbie

            Hi,

            I tried the MyService example code on 3.2.6 and it's not worked for me neither.

            I found out some interesting things which is the client-side's MarshalledInvocation has Method object setup properly. But, the server-side's MarshalledInvocation doesn't has that piece of information. I can see the MarshalledInvocation passed to Method.invoke doesn't have Method setup. Can someone help ?

            TIA, DengYuan

            • 3. Re: exposing jmx mbeans to remote clients
              dengyuan Newbie

              Hi,

              I tried the MyService example code on 3.2.6 and it's not worked for me neither.

              I found out some interesting things which is the client-side's MarshalledInvocation has Method object setup properly. But, the server-side's MarshalledInvocation doesn't has that piece of information. I can see the MarshalledInvocation passed to Method.invoke doesn't have Method setup. Can someone help ?

              TIA, DengYuan

              • 4. Re: exposing jmx mbeans to remote clients
                Amanda Ge Newbie

                I see the same problem on 3.2.6, now fixed in 3.2.7RC1. My intent is to directly invoke target method. However I was forced to provide this invoke() method in MBean on 3.2.6. (Can't specify InvokeTargetMethod=true, otherwise throws "can't find attribute InvokeTargetMethod")

                My side question is there are already many ways to write JMX client for different purposes. For this one purpose, exposing typed MBean interface to remote client, is a common situation. Why we don't follow JMX API way:

                Intf proxy = (Intf)MBeanServerInvocationHandler.newProxyInstance(mbsc, name, Intf.class, false);

                Well, I'll try this if it's just JBossMX doc is not up to date.

                • 5. Re: exposing jmx mbeans to remote clients
                  Dimitris Andreadis Master

                  Do you mean why not using the MBeanServerInvocationHandler.newProxyInstance() method? This produces a local proxy only.

                  • 6. Re: exposing jmx mbeans to remote clients
                    Scott Stark Master

                    Because the MBeanServerInvocationHandler by definition has no remote capabilities. Providing an rpc invocation interface is not under the JMX umbrella. We just happen to built our remoting framework on top of JMX. This will not be the case in JBoss 5.

                    • 7. Re: exposing jmx mbeans to remote clients
                      Amanda Ge Newbie

                      Thanks for clearing up my confusion on MBeanServerInvocationHandler. The confusion comes from newProxyInstance() takes MBeanServerConnection as a signature and the javadoc talks about MBeanServer (which didn't shout 'local' to me).
                      Well seems we users are quickly tied to JMX implementation specific ways for reasonable common features.