Hi,
I have a question on Entity Beans. 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) i.next();
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
Exception
ERROR: [DeployToolWindow.saveAction:1049]
Saving
java.lang.ClassCastException: com.sun.enterprise.deployment.EjbExternalDescriptor
--------------------------------------------------------------------------------
java.lang.ClassCastException: com.sun.enterprise.deployment.EjbExternalDescriptor
at com.sun.enterprise.deployment.EjbReferenceDescriptor.getValue(EjbReferenceDescriptor.java:198)
Is this something to do with ArrayList data structure that i return
Could some please help me with this regard
Thanks,
vishwak
-
ClassCastException Problem (2 messages)
- Posted by: vishwak rajgopalan
- Posted on: November 22 2003 18:08 EST
Threaded Messages (2)
- ClassCastException Problem by Race Condition on November 25 2003 17:13 EST
- ClassCastException Problem by Venkatasubramanian Renganathan on December 06 2003 02:31 EST
-
ClassCastException Problem[ Go to top ]
- Posted by: Race Condition
- Posted on: November 25 2003 17:13 EST
- in response to vishwak rajgopalan
Yes. -
ClassCastException Problem[ Go to top ]
- Posted by: Venkatasubramanian Renganathan
- Posted on: December 06 2003 02:31 EST
- in response to vishwak rajgopalan
From ur code it seems method getCourses() as a private method in studentEJB it returning collection of objects from coursesEJB.whether this CourseEJB local bean.i think problem arise in getting objects.