This discussion is archived
0 Replies Latest reply: Jul 4, 2012 9:16 AM by 947455 RSS

RMI Connection problem

947455 Newbie
Currently Being Moderated
Hi
I'm having some problems with RMI in my program. I'm developing a multiprocessor system building several jars and executing them from the main processor and I'm using RMI and ActiveMQ to communicate them.
I tested it in a Devian and everything worked great, but my client has a RedHat. When i test it in this SO I saw that my RMI service was up and listening, but when I tried lookup at it this exception is thrown

error during JRMP connection establishment; nested exception is: java.io.EOFException

I looked for this exception in google but I didn't find anything that could explain to me what was wrong, why it isn't working when it did before.
My ActiveMQ connection worked fine, or at least I thoutgh it was. Even when it does what it's suppose to do, when I try to stop the service it thows the same exception than before

*ERROR: java.lang.RuntimeException: Failed to execute stop task. Reason: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.io.EOFException*

After seeing this, my guess is that it's not something in my application but something in the the server, something that I should config or something that I should install, but I didn't find anything. I thought that it could be a security problem as well, but I'm calling it from the same server and the ActiveMQ is working (except for the stopping thing).
Have anyone any ideas what the problem could be?

This is my RMI in my server

Remote obj=UnicastRemoteObject.exportObject(this,thisPort);
          Registry registry=LocateRegistry.createRegistry(thisPort);
          
          try {
               registry.bind("server", obj);
          } catch (AlreadyBoundException e) {
               System.out.println("No se pudo establecer la conexion RMI");
               e.printStackTrace();
          }

And this is the lookup in the client

registry = LocateRegistry.getRegistry(COREConstants.PUERTOREGISTRY);
               CoreInterface core= (CoreInterface)(registry.lookup("server"));
               return core.getCampos();

The ports are the same (I even can see when they establish the connection before they die with a netstat -anp|grep port). And as I said before it worked in the other server.
I'm sorry if there are too many grammatical errors I'm not used to write a lot in English
Thanks in advance

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points