Image

RMI help!

I'm having trouble connecting clients to an RMI server.

The server starts up without any problems.
server GameServer has been created on localhost:7777
and bound in the registry to the name GameServer


But I've got a Player object that I want to connect to GameServer. Here's the code:
        GameServer server = null;

try {
server = (GameServer)Naming.lookup("rmi://" + serverMachine +
"/" + serverName);
} catch (Exception e) {
System.err.println("Client exception " + e);
System.exit(1);
}




I can't figure out why an exception is being thrown.

Client exception java.lang.ClassCastException: GameServer_Stub


any help on what it means?