I am trying to retrieve record from a particular column in my data base, after writing the finder
method in the entitybean
, I am getting error from session bean Class Cast Exception: java.lang.String cannot be cast to packagename.PaymentsLocal
. Below is the code snippet in my session bean class
ArrayList a = new ArrayList();
Collection col = null;
try{
col = plh.findByAllSessions();
Iterator i = col.iterator();
while(i.hasNext()){
pl = (PaymentsLocal)i.next();
a.add(new paymenthelper( pl.getSession()));
}
} catch (Exception e) {
System.out.println("viewing all sessions"+e.getMessage());
}
return a;
}