Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PortableRemoteObject.narrow()??

843793Jan 11 2006 — edited Jan 12 2006
Hi,

I previously had the following fragment of code inside a servlet (which worked fine):
Context ctx = new InitialContext();
BeanEJB beanEJB = null;
BeanEJBHome beanHome = null;

Object obj = ctx.lookup("ejb/BeanEJB");
beanHome = (BeanEJBHome ) PortableRemoteObject.narrow(obj, BeanEJBHome.class);
However, I moved the above code to the run() method of a new thread I created and now the PortableRemoteObject.narrow() call throws a ClassCastException.

Can anyone help?

Thank you!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 9 2006
Added on Jan 11 2006
2 comments
141 views