Exception in thread "main" java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.io.NotSerializableException: ClientIMImpl
java.io.NotSerializableException: ClientIMImpl
at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java, Compiled Code)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java, Compiled Code)
at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java, Compiled Code)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java, Compiled Code)
at ServerAdminImpl_Stub.registerRemoteObjs(Unknown Source)
at simpleClient.main(simpleClient.java, Compiled Code)
Here's the interface and implementation of ClientIM:
import java.rmi.*;
import java.rmi.RemoteException;
/**
* ClientImManager provides an interface for peer-client to send instant message to this client
*/
public interface ClientIMIntf extends Remote {
public boolean instantMsg( String group, String senderID, String content ) throws RemoteException;
}
/*****************************************************************/
import java.rmi.*;
import java.io.*;
public class ClientIMImpl implements ClientIMIntf{
public ClientIMImpl() throws RemoteException{
}
public boolean instantMsg(String group, String senderID, String content ) throws RemoteException{
System.out.println(" client instantMsg ");
System.out.println("group: " + group);
System.out.println("senderID: " + senderID);
System.out.println("content: " + content);
return true;
}
}
Thank you for any help.
Kai
Another question is when client calls register, is the reference or a copy
of THIS clientIM being sent? I guess it's the copy being sent.
Is there any better way to implement this client to client communication
model? any way to avoid going through the server? If I make the client as
a server as well, the client needs a hostname. That doesn't make sense cuz
most of online users' machine only have dynamics IP.
Thanks.
--
Kai
Please remove "~" from the email address when you reply by email
"Class Account" <cs16...@quasar.CS.Berkeley.EDU> wrote in message
news:8toc8n$8v4$1...@agate.berkeley.edu...
Ta.
Gavin.
"Class Account" <cs16...@quasar.CS.Berkeley.EDU> wrote in message
news:8toc8n$8v4$1...@agate.berkeley.edu...