?
=?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);
}
}
}
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);
}
}
}