This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Casting Failed!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Casting Failed!!!" Watch "Casting Failed!!!" New topic
Author

Casting Failed!!!

Brian Smith
Ranch Hand

Joined: Oct 26, 2002
Posts: 232
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

Joined: Sep 27, 2001
Posts: 133
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

Joined: Oct 26, 2002
Posts: 232
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.
 
GeeCON Prague 2014
 
subject: Casting Failed!!!