RMI problems with kaffe 0.10.x

Nathan Lutchansky Nathan_Lutchansky at legis.state.ak.us
Fri Jun 26 14:38:52 PDT 1998


Hi all,

I've looked through the archives and can't find anybody mentioning any RMI
problems before, but this problem seems too general to be my setup.

Kaffe seems to be running great for me otherwise.  I'm using Kaffe 0.10.1
with Linux Slackware 3.1, libc v5.3.12, kernel 2.0.32.

I constructed a test program for RMI, and it runs as expected with the
Linux 1.1.5 JDK and the Win32 1.1.5 JDK.  It consists of Client class to
look up an object on a remote system, and a Sender class that implements
the RemoteSender interface to return the String "Test message".  I
attached the source to the end of this message.

When I attempt to compile and run this program under Kaffe 0.10.1, I get a
variety of errors.  Trying to start Sender under Kaffe:

| laa_linux:~/rmitest$ ls
| Client.java        RemoteSender.java  Sender.java
| laa_linux:~/rmitest$ javac *.java
| laa_linux:~/rmitest$ rmic Sender
| laa_linux:~/rmitest$ rmiregistry &
| [1] 11344
| laa_linux:~/rmitest$ kaffe Sender
| Started sender
| java.lang.NullPointerException
|         at java/io/ObjectOutputStream.checkSpecialClasses(290)
|         at java/io/ObjectOutputStream.writeObject(182)
|         at java/io/ObjectOutputStream.defaultWriteObject(325)
|         at java/io/ObjectOutputStream.outputObject(707)
|         at java/io/ObjectOutputStream.writeObject(225)
|         at sun/rmi/server/UnicastServerRef.dispatch(192)
|         at sun/rmi/transport/Transport.serviceCall(161)
|         at sun/rmi/transport/tcp/TCPTransport.handleMessages(593)
|         at sun/rmi/transport/tcp/TCPTransport.run(499)
|         at java/lang/Thread.run(116)
| java.lang.NullPointerException
|         at java/io/ObjectOutputStream.checkSpecialClasses(290)
|         at java/io/ObjectOutputStream.writeObject(182)
|         at java/io/ObjectOutputStream.defaultWriteObject(325)
|         at java/io/ObjectOutputStream.outputObject(707)
|         at java/io/ObjectOutputStream.writeObject(225)
|         at sun/rmi/server/UnicastServerRef.dispatch(192)
|         at sun/rmi/transport/Transport.serviceCall(161)
|         at sun/rmi/transport/tcp/TCPTransport.handleMessages(593)
|         at sun/rmi/transport/tcp/TCPTransport.run(499)
|         at java/lang/Thread.run(116)
<Control-C>
| laa_linux:~/rmitest$

Trying to run Sender on an NT computer and accessing it with Kaffe Client:

| laa_linux:~/rmitest$ kaffe Client rmi://ldpcnat-nt/msg
| java.rmi.UnmarshalException: Error unmarshaling return; nested exception
| is:
|         java.io.InvalidClassException: Sender_Stub; Local class not
| compatible
|         at java/lang/Throwable.<init>(89)
|         at java/lang/Exception.<init>(53)
|         at java/io/IOException.<init>(53)
|         at java/rmi/RemoteException.<init>(45)
|         at java/rmi/UnmarshalException.<init>(38)
|         at sun/rmi/registry/RegistryImpl_Stub.lookup(107)
|         at java/rmi/Naming.lookup(60)
|         at Client.main(8)
| laa_linux:~/rmitest$

I get the same error regardless of whether I use the classes.zip file from
the Win32 JDK 1.1.5, Win32 JDK 1.1.6, SPARC JDK 1.1.6, or Linux JDK
1.1.5v7.  Both the Linux and NT computers in the above tests are using the
Win32 JDK 1.1.5 classes.zip. 

The only thing I can think of is that somehow the Kaffe VM is storing
objects in a format that the JDK classes aren't expecting.  Has anybody
else seen this problem?  Or is anybody successfully running RMI under
Kaffe?

If you've read this far through this message, thanks for your time.
-Nathan

------------------------------------------

// RemoteSender.java

// interface for sending a simple message with RMI

public interface RemoteSender extends java.rmi.Remote
{

public abstract String getMessage() throws java.rmi.RemoteException;

}

------------------------------------------

// Sender.java

// remote object to send a simple message to clients

public class Sender extends java.rmi.server.UnicastRemoteObject
  implements RemoteSender
{

String msg;

public Sender() throws java.rmi.RemoteException
{
	System.out.println( "Started sender" );
	msg = new String( "Test message" );
}

public String getMessage()
{
	return msg;
}

public static void main( String args[] )
{
	try
	{
		Sender s = new Sender();
		java.rmi.Naming.rebind( "msg", s );
	}
	catch( Exception e ) { e.printStackTrace(); System.exit( 0 ); }
}

}

------------------------------------------

// Client.java

// client for receiving a message from the Sender

public class Client
{

public static void main( String args[] )
{
	try
	{
		RemoteSender r;
		r = (RemoteSender)(java.rmi.Naming.lookup( args[0] ));
		System.out.println( r.getMessage() );
	}
	catch( Exception e ) { e.printStackTrace(); }
	System.exit( 0 );
}

}

------------------------------------------

(End of sources)



More information about the kaffe mailing list