4 Replies Latest reply on Oct 1, 2002 12:53 PM by javajohnson

    Why is RMI so difficult to set up?

      I've been struggling all day trying to get a simple HelloWorld type application running on JBoss 3.0 (I actually upgraded to 3.02 hoping there was a bug!)

      Every post I saw and piece of literature I read seemed to point to JBoss uses SSL when doing RMI calls. Is this true?

      So, if I have to use SSL, how do I configure my service.xml file. I followed the directions on 301-304 in JBossBook_30x.pdf to set up SSL for EJBs, thinking it was similar to RMI.

      I can get my JBoss server to start up fine, and I see bindings for the JRMP stuff initiating fine, but when I try to run a seperate JVM to bind my RMI server, I fail with a NullPointer in DomainServerSocketFactory.java

      Can anyone help? Or can anyone point me to someone that can? I hope I am just missing something silly!

      Thanks!

      Mark Johnson

        • 1. Re: Why is RMI so difficult to set up?
          joelvogt

          umm, not too sure on this one. But are you trying to do a rmi lookup in your hello world application? If your not doing anything tricky, then jboss should already be set up and ready to go as it is. Maybe can you post more details about your hello world app and where it is failing?

          • 2. Re: Why is RMI so difficult to set up?

            Sure, I'll post some more details.

            My HelloWorld app is actually the RMI tutorial on Sun's website:
            http://java.sun.com/docs/books/tutorial/rmi/overview.html

            It is a 'computing engine'. The UnicastRemoteObject derived class has a single method with a signature of

            public Object executeTask(Task t)

            A Task is an interface with an execute method.

            This is what I did up to this point. All standard RMI.

            1. Created a UnicastRemoteObject derived class called ComputeEngine that also has a main method to actually do the binding.
            2. Created a client class that implemented the Task interface. The class Computes Pi.
            3. Created a client app with a main method to do the naming lookup and send the Pi class to the server for processing.

            When I use the rmiregistry command from the JDK (1.3.1) to handle the binding everything works fine. If I stop the rmiregistry command and start up JBoss, I get the following:

            java.rmi.MarshalException: Transport protocol not supported by server
            at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:203)
            at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
            at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
            at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
            at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
            at com.dsicdiiti.rmidemo.engine.ComputeEngine.main(ComputeEngine.java:46)


            The parameters to the Naming.rebind(addr,obj) call are

            addr= "//192.168.0.116/Compute"
            obj=a ComputeEngine Instance

            The IP addr is my local machine.

            This exception is what led me down the path that RMI only supports SSL, which got me to configure SSL and get the null pointer in line 111 of DomainServerSocketFactory.java

            I really just hope I am over-complicating things. Can I specify bindings at JBoss startup?

            Thanks,

            Mark

            • 3. Re: Why is RMI so difficult to set up?
              cumulus

              Hi,

              >> java.rmi.MarshalException: Transport protocol not supported by server

              If you are getting this exception then I am wondering, are you using port 1099 for RMI? If so, JBoss uses this port for JNDI, which it uses for binding objects. If you have a separate RMI Registry try using a different port number so there is no transport protocol conflict.

              • 4. Re: Why is RMI so difficult to set up?

                Hmm, that would make sense then.

                I thought port 1099 was the standard RMI Registry port. Deos this mena that JBoss does not act as a RMI Registry? I assumed it did.