This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes ClassCastException 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 "ClassCastException" Watch "ClassCastException" New topic
Author

ClassCastException

richard marais
Ranch Hand

Joined: Aug 20, 2001
Posts: 30
When I try the following I get a ClassCastException.
java.util.Enumeration e = home.findGreaterThan(0);
while (e.hasMoreElements())
{
Bean bean = (Bean)e.nextElement();
System.out.println(bean.getMethod());
}
I am trying to process multiple rows from the EJB Bean. How should I do this?
richard marais
Ranch Hand

Joined: Aug 20, 2001
Posts: 30
I solved the above problem with the following:
java.util.Enumeration e = home.findGreaterThan(11);
while (e.hasMoreElements())
{
Object ref = e.nextElement();
Ory_menu ory_menu = (Ory_menu) PortableRemoteObject.narrow(ref, Ory_menu.class);
System.out.println(ory_menu.getSort_order());
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassCastException
 
Similar Threads
Extend Test - ClassCastException
Handleing multiple rows from an EJB
classCastException
Deploying Servlet in EJB
some problem with Entity Bean with PK