java.lang.classcastexception: [ljava.lang.object; cannot be cast to - Essay Example

What is the code to retrieve data from the list while i execute the above code i get this exception java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.beans.EmployeePm

public String showEmpHome(ModelMap map) {
System.out.println(“inside showEmpHome/empHomeController”);
EmployeePm empPm = new EmployeePm();

We Will Write A Custom Essay Sample On
ANY TOPIC SPECIFICALLY
FOR YOU

For Only $13.90/page


order now

int empCode = Integer.parseInt(htSession.getAttribute(“empCode”).toString());//get empCode from session

List<EmployeePm> list = empHomeSer.getEmpHome(empCode);
System.out.println(“List size=” + list.size());

for (int i = 0; i < list.size(); i++) {

System.out.println(“fddfg = “+list.get(i));
String wrk = list.get(i).getWorkAssigned().toString();
System.out.println(“work = “+wrk);
}

map.addAttribute(“tabList”, list);
System.out.println(“end of showEmpHome/empHomeController”);
return “empHome”;
}