Hi all, I am getting class cast exception when I try to execute this code in this line roles = (Roles) it.next();
public void loadRolesList() { | List<Roles> list = (List<Roles>) em | .createQuery( | "select r.iroleId, r.strDescription from Roles r order by r.iroleId") | .getResultList(); | log.info("Query executed = " + list.size()); | Roles roles; | ListIterator<?> it = list.listIterator(); | while(it.hasNext()){ | roles = (Roles) it.next(); | log.info("Id = " + roles.getIroleId()); | rolesList.add(new SelectItem(roles.getIroleId(), roles | .getStrDescription())); | } | } | I am not sure if it is the right way of doing it but I want to iterate the list in java only. Any help would be appreciated. Thanks, Vikram View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121340#4121340 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121340 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user