Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ClassCastException

 
harcharan kanwal
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i am fighting with ClassCastException .Seems like i completed all the neccessary steps to obtain a remote object. Here is my code
OBJECT BOUNDED WITH REGISTRY:-
String url = "//localhost/Newtester";
RemoteDataInterface remoteObject = new DataRequestServer();
Naming.rebind( url, remoteObject);

LOOKING UP THE REMOTE OBJECT:-
String url = "//Newtester";
Object ob = Naming.lookup(url);
remoteObject = (RemoteDataInterface)ob;

I can not cast ob to RemoteDataInterface
is there help
kanwal
 
harcharan kanwal
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx guys
i was binding and finding two different names on the registry
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!