java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassCastException: java.io.ObjectStreamClass cannot be cast to java.lang.String
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
at com.nxl.smssession.SessionRMI.<init>(SessionRMI.java:33)
at com.nxl.smssession.Main.main(Main.java:33)
Caused by: java.lang.ClassCastException: java.io.ObjectStreamClass cannot be cast to java.lang.String
Can someone explain why this error is happening
This is happening when i am doing RMI Bind Operation
This problem is happening on SOLARIS System only, it is working fine in windows and Linux
Here is the code which generates this error
public SessionRMI(String servicename) throws AlreadyBoundException {
SessionImpl service = new SessionImpl();
try {
logger.debug("Publishing the SMS Session endpoint "+servicename);
SessionIface stub = (SessionIface) UnicastRemoteObject.exportObject(service, 0);
Registry registry = LocateRegistry.getRegistry(); registry.rebind(servicename, stub);
logger.debug("SMS Session endpoint published successfully "+servicename);
} catch (RemoteException ex) {
logger.error(ex.toString()); ex.printStackTrace();
}
}
Thanks in advance