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());