I need serious help in this matter. It may be very simple, but I cannot understand it. I have an EJB session with one method that returns an array of enums, i.e. Array BlndItmTmMthd. When I call a client-side method, it gives me ClassCastException.
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [LBlndItmTmMthd
During debugging, I found that the ejb method correctly returns an array BlndItmTmMthdby calling BlndItmTmMthd.values(). I can’t find out the reason. Any idea would be helpful.
Added content from the comment below
InterfaceSession.java is an EJB interface that contains the following method declaration:
BlndItmTmMthd[] getAllBlendedItemTimingMethods();
SessionEJB.java is an EJB that implements it.
public BlndItmTmMthd[] getAllBlendedItemTimingMethods() {
BlndItmTmMthd[] blendedItemTmingMethods = BlndItmTmMthd.values();
return blendedItemTmingMethods;
}
, , EJB :
BlndItmTmMthd[] _timingMethods =
getLoanScheduleSetupSession().getAllBlendedItemTimingMethods();
.