3 Replies Latest reply on Sep 16, 2003 8:33 AM by mlange

    Connecting to remote MBean server - invalid class

    mlange

      I am connecting to two JBoss instances remotely via the RMIAdapter. One is JBoss 3.0 and one is JBoss 3.2. I am running into the following problem when talking to the remote instance:

      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
      java.io.InvalidClassException: javax.management.ObjectName; local class incompatible: stream classdesc serialVersionUID = 1081892073854801359, local class serialVersionUID = 2846767152916764670

      This occurs when the jmx-libraries on the server do not match the libs on the client, e.g. if I try to connect to a 3.2 instance with the jboss-jmx.jar from JBoss 3.0. When using the same libs everything works fine.

      How can I tell the client (a web application) to use the 3.2 libraries? I tried to put the correct jboss-jmx.jar into WEB-INF/lib but this didn't work understandably. Or is there another way to avoid the exception?

      Thanks,

      -marek

        • 1. Re: Connecting to remote MBean server - invalid class

          Hmm, tricky one, the ObjectName in JMX 1.0 (in JBoss 3.0) is not serialization compatible with JBoss 3.2 (which is the first JBoss version that uses JMX 1.1 which was the first JMX spec to define serialization compatibility).

          And I can't think of an obvious way for you to replace the 3.0 javax.management implementation since the JMX libs are part of the bootstrap (IIRC loader repository for SARs [mbeans] is only available in JBoss 3.2).

          One solution (and this requires you to write some code but its easy code to write) is to create your own connector implementation which passes object names as strings rather than ObjectName instances. And then convert those strings to Object Names on the server side before invoking the MBean Server.

          Connectors are really easy to write, just have a look at the current source (albeit its convoluted one) for RMIConnector or check some of the sources I included with the JMX book to get yourself forward (http://www.samspublishing.com/content/images/0672322889/downloads/code.zip).

          Right now that's the best solution that comes to my mind.

          -- Juha

          • 2. Re: Connecting to remote MBean server - invalid class
            mlange

            Thanks Juha, I will check that out and give a feedback afterwards.

            -marek

            • 3. Re: Connecting to remote MBean server - invalid class
              mlange

              I have decided to write a thin RMI implementation wrapped in an mbean for talking to the remote instance.

              -marek