"java.lang.ClassCastException: org.omg.stub.javax.ejb._EJBObject_Stub" thrown when iterating through enumeration in WebSphere Application Server 5.0.x
 Technote (troubleshooting)
 
Problem(Abstract)
In WebSphere Application Server 5.0.x, a finder method for an EJB 1.1 entity bean returns an enumeration to an EJB client. When the client iterates through the enumeration and casts it to get the remote EJB object, the following exception is thrown:

java.lang.ClassCastException: org.omg.stub.javax.ejb._EJBObject_Stub
 
Cause
The EJB 1.1 specification states that the javax.rmi.PortableRemoteObject.narrow(...) method must be used rather than a cast when referencing an EJB object obtained from an enumeration or collection.
 
Resolving the problem
To resolve the problem, use the javax.rmi.PortableRemoteObject.narrow(...) method rather than a cast to reference the EJB object.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > EJB Container
Operating system(s): Windows
Software version: 5.0
Software edition:
Reference #: 1116967
IBM Group: Software Group
Modified date: Aug 20, 2003