Hi All,
I need a serious help in this issue. May be its very basic, but, I am not able to figure it out. I have a session EJB with one method which returns an enum array, i.e. BlndItmTmMthd
array. When, I call the method in the client side, it gives me a ClassCastException
.
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [LBlndItmTmMthd
While debugging, I have found that the ejb method is correctly returning BlndItmTmMthd
array by calling BlndItmTmMthd.values()
. I am not able to find out the reason. Any idea will be helpful.
Added content from a comment below
AgreementSession.java is the EJB interface which contains the following method declaration:
BlndItmTmMthd[] getAllBlendedItemTimingMethods();
AgreementSessionEJB.java is the EJB that implements it.
public BlndItmTmMthd[] getAllBlendedItemTimingMethods() {
BlndItmTmMthd[] blendedItemTmingMethods = BlndItmTmMthd.values();
return blendedItemTmingMethods;
}
Now, at the client side, when I invoke the EJB method with the following code:
BlndItmTmMthd[] _timingMethods =
getLoanScheduleSetupSession().getAllBlendedItemTimingMethods();
I get that runtime exception.