3 Replies Latest reply on Aug 5, 2004 2:07 AM by Tom Elrod

    Sample JSR160 code for Jboss?

    Ajay Balan Newbie

      Are there any sample JSR160 code for Jboss?
      I have tried some RI samples for remoting, but am having trouble, with
      ClassCastExceptions.


      Thanks

        • 1. Re: Sample JSR160 code for Jboss?
          Tom Elrod Master

          There currently is not support for the JSR160 specification. There is, however, support for remote JMX, but is not compliant with JSR 160. What tests are you running?

          • 2. Re: Sample JSR160 code for Jboss?
            Ajay Balan Newbie

            Using the JMX remote api:

            I am trying toconnect to a Jboss Server via RMI
            using the following code:

            JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://testhost1:1098/");

            JMXConnector jmxc = JMXConnectorFactory.connect(url, null);

            and get the following error:

            java.lang.ClassCastException
            at javax.management.remote.rmi.RMIConnector.narrowJRMPServer(RMIConnector.java:1626)
            at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1621)

            any ideas how I could connect to RMI using the
            MBeanServerInvocationHandler class instead?

            Thanks!

            • 3. Re: Sample JSR160 code for Jboss?
              Tom Elrod Master

              You are using the JSR 160 APIs, which we don't yet support.

              Can find an example of how to do the same thing in PingPongTest (will have to get the source). Is in jmx-remoting\src\test\jboss\test\mx\remoting\pingpong\PingPongTest.java.

              In this example, it explicitly sets the handler. Can go to remoting-service.xml in the deploy directory and add the handler there, so will be available on startup.