Reputation: 385
GameV1 game;
public void connect() {
connect("//localhost/Game");
if (getServer() != null) {
game= (GameV1) getServer();
}
}
this method "connect("//localhost/Game");" just sets the server on the upperclase which then is casted to GameV1 Game=interface GameV1=concrete class with implements Game
if (getServer() != null) this returns true but i get this error when cast com.sun.proxy.$Proxy1 cannot be cast to GameV1
Upvotes: 0
Views: 9745
Reputation: 33083
With a RMI remote object you can't cast to the concrete class. You have to cast to the remote interface.
Upvotes: 7