This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes ClassCastException problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "ClassCastException problem" Watch "ClassCastException problem" New topic

ClassCastException problem

vishwak rajgopalan

Joined: Nov 19, 2003
Posts: 8
I have two entity beans StudentEJB and CourseEJB which implement a M:N relationship. The beans implement local interfaces. StudentEJB has a method
called getCoursesOfStudent() which returns as the list of courses a student is
involved in as an ArrayList. The code snippet is as follows:
public ArrayList getCoursesOfStudent() {
ArrayList courseList = new ArrayList();
Collection courses = getCourses();
Iterator i = courses.iterator();
while (i.hasNext()) {
LocalCourse courselocal = (LocalCourse);
String course_name = courselocal.getCourseName();
courseList.add( course_name );
return courseList;
when i try to save the ear file containing StudentEJB and CourseEJB i get the following error
ERROR: [DeployToolWindow.saveAction:1049]
java.lang.ClassCastException: com.sun.enterprise.deployment.EjbExternalDescriptor
java.lang.ClassCastException: com.sun.enterprise.deployment.EjbExternalDescriptor
at com.sun.enterprise.deployment.EjbReferenceDescriptor.getValue(
Is this something to do with ArrayList data structure that i return
Could some please help me with this regard
I agree. Here's the link:
subject: ClassCastException problem
It's not a secret anymore!