Posted By:
Matt_Senecal
Posted On:
Friday, October 12, 2001 12:00 PM
A client I've written is trying to connect to a server that resides on another machine. The server is an implementation of the interface MyServer, and is called MyServerImpl. During the Naming.lookup() call in the client I'm getting a ClassCastException: java.lang.ClassCastException: MyServerImpl_Stub This is the code in question: MyServer my_server = null; String name = "//121.0.0.42/MyServer"; my_server = (MyServer)Naming.lookup( name ); //exception thrown here I've checked, and there *is* a stub being returned from the lookup call. The server is up and running on the other machine, and was compiled from the same code that the client is referen
More>>
A client I've written is trying to connect to a server that resides on another machine. The server is an implementation of the interface MyServer, and is called MyServerImpl. During the Naming.lookup() call in the client I'm getting a ClassCastException:
java.lang.ClassCastException: MyServerImpl_Stub
This is the code in question:
MyServer my_server = null;
String name = "//121.0.0.42/MyServer";
my_server = (MyServer)Naming.lookup( name ); //exception thrown here
I've checked, and there *is* a stub being returned from the lookup call. The server is up and running on the other machine, and was compiled from the same code that the client is referencing. From what I can tell, this should work, but apparently there's a disagreement between the stub being returned and the variable used to hold it. Anyone have any ideas why it's not working?
<<Less