java.lang.ClassCastException
Hello,
I want to pass an object called UserNodeData through RMI from the server to the client.
In the client side i create an object with the type of the interface of UserNodeData (the interface is called RemoteLinkman) . Here is the piece of code that make the error (client side) :
RemoteLinkman server;
public void afficher(Graph g) throws RemoteException {
UserNodeData d = (UserNodeData)server.getRootNode();
UserNode node = new UserNode(d,g,this);
node.afficherLesVoisins(5);
}
I launch the server side first and then i want to launch the client. After that the connection is established is the following error (on the piece of code behind) :
Exception in thread "main" java.lang.ClassCastException: $Proxy2 cannot be cast to ch.globalcard.linkman.server.UserNodeData
at $Proxy1.getRootNode(Unknown Source)
at linkman.NodeManagerClient.afficher(NodeManagerClient.java:36)
What can be the origin of this error ?
Best regards

