RMI under Linux -> exception: Connection reset

  • Thread starter =?iso-8859-1?Q?L=E9on?= Planken
  • Start date
?

=?iso-8859-1?Q?L=E9on?= Planken

Hello,

I'm trying to get RMI running on our lab pcs, but I think there's
something wrong with the configuration.
I'm using the example in the tutorial on
<http://www.ccs.neu.edu/home/kenb/com3337/rmi_tut.html>; a 'Hello,
World' program using RMI.

The involved classes/interfaces are straightforward; see URL or below
(comments snipped).

Compiling with javac and rmic yields no errors.
Running the server gives the following exception:

Hello Server failed: java.rmi.UnmarshalException: Error unmarshaling
return header; nested exception is:
java.net.SocketException: Connection reset

This differs from when the rmi registry isn't running, or is listening
to another port than the default 1099. In that case I get 'connection
refused'.

I think this somehow has to do with the configuration of the system. I
toyed with the address given to Naming.rebind and with SecurityManagers,
with a security policy and with the code base, but I don't think these
settings actually cause the problem. The same program runs correctly on
other systems.

Finally, here's the output from `uname -a`:
Linux xxx.yyy.zz 2.4.20-19.9 #1 Tue Jul 15 17:18:13 EDT 2003 i686 i686 i386 GNU/Linux

Any help appreciated.

Leon

here are the three files:

// HelloInterface.java
import java.rmi.*;
public interface HelloInterface extends Remote {
public String say() throws RemoteException;
}

// Hello.java
import java.rmi.*;
import java.rmi.server.*;
public class Hello extends UnicastRemoteObject implements HelloInterface
{
private String message;
public Hello (String msg) throws RemoteException
{
message = msg;
}
public String say() throws RemoteException
{
return message;
}
}

// HelloServer.java
public class HelloServer
{
public static void main (String[] argv)
{
try {
java.rmi.Naming.rebind ("Hello", new Hello ("Hello, world!"));
System.out.println ("Hello Server is ready.");
} catch (Exception e) {
System.out.println ("Hello Server failed: " + e);
}
}
}
 
G

Guest

Hello,

I'm trying to get RMI running on our lab pcs, but I think there's
something wrong with the configuration.
I'm using the example in the tutorial on
<http://www.ccs.neu.edu/home/kenb/com3337/rmi_tut.html>; a 'Hello,
World' program using RMI.

The involved classes/interfaces are straightforward; see URL or below
(comments snipped).

Compiling with javac and rmic yields no errors.
Running the server gives the following exception:

Hello Server failed: java.rmi.UnmarshalException: Error unmarshaling
return header; nested exception is:
java.net.SocketException: Connection reset

This differs from when the rmi registry isn't running, or is listening
to another port than the default 1099. In that case I get 'connection
refused'.

1) Is the RMI server running?
2) Is it listening on the standard port?
3) Has your program (server side) been registered with the RMI server?

By answering these three questions, odds are you will solve your problem.

Aloha,
La'ie Techie
 
?

=?iso-8859-1?Q?L=E9on?= Planken

Hi,

I failed miserably to keep a straight face when I read that
1) Is the RMI server running?
2) Is it listening on the standard port?
3) Has your program (server side) been registered with the RMI server?

By answering these three questions, odds are you will solve your problem.

As I stated, the example did work on another system. I also wrote that
I got a 'connection refused' when listening to the nonstandard port, so
that probably wasn't the problem. As to your first point, the example
program was the RMI server only, not the client, so that doesn't make
sense.

But I found out what the problem was. An incompatible version of
rmiregistry was being used.

Thanks anyway,

Léon (aka Oliphaunt)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,042
Latest member
icassiem

Latest Threads

Top