It's not a secret anymore!*
The moose likes EJB and other Java EE Technologies and the fly likes Class Cast Problem using PortableRemoteObject.narrow Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Class Cast Problem using PortableRemoteObject.narrow" Watch "Class Cast Problem using PortableRemoteObject.narrow" New topic
Author

Class Cast Problem using PortableRemoteObject.narrow

Joe Lee
Greenhorn

Joined: Aug 01, 2002
Posts: 7
Hi All,
I’m currently deploying a session bean to OC4J.
On calling the bean from a JSP using:-
Object boundObject=context.lookup(“Travel” ;
String className= boundObject.getClass().getName();
I found that the className value is: TravelHome_StatelessSessionHomeWrapper3
If I attempt the following within the JSP I get a cast exception ???

TravelHome home = (TravelHome)
PortableRemoteObject.narrow(
boundObject,TravelHome.class);
I’m not sure why TravelHome_StatelessSessionHomeWrapper3 is used.
I checked orion-ejb-jar.xml under directory application-deployment, it contains:-
<orion-ejb-jar>
<enterprise-beans>
<session-deployment wrapper=” TravelHome_StatelessSessionHomeWrapper3”
I’m not sure how to get arround this problem, any ideas.
Joe Lee
Greenhorn

Joined: Aug 01, 2002
Posts: 7
Hi all,
Using similar code within an application, I was able to call the EJB. Still having problems calling from a JSP due to the class cast exception; any ideas???.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Class Cast Problem using PortableRemoteObject.narrow
 
Similar Threads
Deployment Problem ???
JNDI Context Problem
EJB Home Cast Exception
jsp:useBean tag
JNDI name lookup problem in session bean