This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Casting Failed!!!

 
Brian Smith
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi folks,
All the classes compile successfully. whey deploy and excetue my client, my look up is successful and when it reaches to the point where Object narrow is done, it fails. and the codes and the error is as follow:

could you please help why the object narrowing fails?
thanks.
 
Anurag Mishra
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to do it like this:-
Context initctx = new InitialContext();Object objref = initctx.lookup("HelloRef");
HelloHome helloHome = (HelloHome)PortableRemoteObject.narrow(objref, HelloHome);
Hope This help,
Anurag
 
Brian Smith
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anurag,
if i omit the .class part from HelloHome.class, the class would not even compile. i don't know why i am having with this.please someone give me some suggestion here.
thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic