5 Replies Latest reply on Mar 24, 2003 12:48 PM by Dave Roxburgh

    architecture question

    Jonathan Budar-Danoff Newbie

      Hi Folks.

      Obligatory qualifier: I'm new here (here being JBoss, J2EE, JMX).

      I have a working knowledge of JMX, in that I built a proof-of-concept app using 2 MBean classes (a controller class which instantiates 4 instances of the other MBean class) which I was able to deploy on one machine using the JMX RI and then control from a 2nd machine. I've not yet been able to deploy this using JBoss, however, so I figured that I would take a step back, simplify, and try again.

      In a nutshell, here's what I'm trying to do:

      1. have an application running on machine A
      2. have JBoss running on machine B
      3. have a client running on machine C

      The application (on A) will be instrumented via Standard MBeans (for now, possibly Model MBeans or some other type later) to allow monitoring and control.

      Assuming that this can be done, here are my questions:

      1. How does the application on A talk to the MBeanServer within JBoss? I suspect that the answer lies somewhere in the JNDI mechanism, but I don't quite understand what that's all about.

      2. What exactly do I deploy on B -- only those MBeans that are responsible for monitoring/controlling the application on A and those that the client on C will talk to?

      I've looked through various example code (JBoss 3.0 templates and examples, JBoss workbook, etc.) but they all seem to based on EJBs, not MBeans, so I'm just plain confused.

      Thanks, in advance,
      jmb-d

        • 1. Re: architecture question
          Jeff Haynie Newbie

          The functionality you're looking for is part of the JSR 160 - JMX Remoting specification. This specification defines how a client can access remote MBeans to handle invocation.

          We do have this working in HEAD (not JSR compatible since the JSR is still in internal draft), but the full implementation (including JSR160) will be part of the JB4.0 release - which is due out around June.

          So, depending on your time requirements, you can either use what we have in HEAD now, or wait a little bit and get a more fully supported JMX Remoting framework on the official release.

          • 2. Re: architecture question
            Pratik Patel Newbie

            Hello,

            how is the code in HEAD any different than the JBossMX 1.1.2 release that Juha posted a few weeks ago (I assume they are the same code... but we all know what happens when you assume...) ? See:

            http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ what I can tell of the JBossMX 1.1.2 release, it looks like there is some initial support for Remoting.

            cheers
            Pratik

            • 3. Re: architecture question
              Pratik Patel Newbie

              Ok, I answered my own question (don't you hate it when that happens?)... they are the same thing (except, of course, if you checkout the jbossmx module from CVS you get the latest and greatest)

              <to the original poster of this topic>
              And yes, there is some preliminary support for Remoting! There is a sample you can run to see JMX remoting for yourself.

              cheers
              Pratik

              • 4. Re: architecture question
                Juha Lindfors Master

                If you're using JBoss 3.0.x version you can use the RMI adaptor to connect to the JBoss MBean server:

                String connectorName = "jmx/rmi/RMIAdaptor";
                RMIAdaptor server = (RMIAdaptor) new InitialContext().lookup(connectorName);

                where RMIAdaptor interface contains the relevant methods of the MBeanServer interface.

                • 5. Re: architecture question
                  Dave Roxburgh Newbie

                  Really?

                  I have an EJB accessing the local RMIAdaptor via the RMIAdaptorImpl object (where the code above uses the RMIAdaptor object). When I try to use that same code to access an RMIAdaptor on a remote JBoss instance I get ClassCastException: org.jboss.jmx.adaptor.rmi.RMIAdaptorImpl_Stub

                  For accessing RMIAdaptors on remote seervers, should I cast to RMIAdaptor or RMIAdaptorImpl_Stub? The problem is I can't find where to import either of these classes.

                  TIA,
                  Dave