aspose file tools*
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
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???.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Class Cast Problem using PortableRemoteObject.narrow