aspose file tools*
The moose likes Beginning Java and the fly likes Getting java.lang.ClassCastException. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Getting java.lang.ClassCastException.

Amith Bhavikatti
Greenhorn

Joined: Oct 27, 2006
Posts: 26
This is my method in which i call hibernates through EJB and assign that list of database values from the HQL to a class called AssignmentByLetter where getters and setters are there for all the values which are coming from the database and residing in list.
It is giving java.lang.ClassCastException..
Please help me out..
This is my code
[code]
public List getAllAssignmentByLetter()
{
assignmentByLetterList = new ArrayList();
try {
logger.debug("getAllAssignmentByLetter");
List list = taskSession.getAllAssignmentByLetter();
logger.debug("After getting from Hibernates"+ list.size());
for (Iterator iter = list.iterator(); iter.hasNext() {
logger.debug("Inside Iterator Loop"+ iter.next());
AssignmentByLetter assign = (AssignmentByLetter) iter.next();
assign.setStartValue(assign.getStartValue());
assign.setEndValue(assign.getEndValue());
assign.setCollector(new Collector(assign.getCollector().getCollectorID()));
assign.setGroup(new Group(assign.getGroup().getGroupID()));
assignmentByLetterList.add(assign);
}
}
catch (Exception e) {
logger.error(e.getMessage());

}
return assignmentByLetterList;
}
[\code]

Thanks in Advance
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3156
    
  10
Don't post the same question in multiple forums.


Joanne
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
Originally posted by Joanne Neal:
Don't post the same question in multiple forums.


And read our naming policy.

Closing thread.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting java.lang.ClassCastException.
 
Similar Threads
Getting java.lang.ClassCastException.
Getting java.lang.ClassCastException.
Error java util NoSuchElementException
Submit multipart and form data
Can i assign the returned list from hibernate like this