ClassCastException when loading a simple entity

Hi guys,

I am encountering a problem in my business application that in my mind should not happen. I’m asking for your help in order to either fix it on my side or on yours.

I created a sample project that mirrors the exact model that I’m using in my application where it crashes.

My model is pretty simple: I have a base class named BaseClassType. Then two classes inherit it (TestType and TestClassType). Then I have a ONE_TO_MANY association between TestClassType and TestType.

Then I have a class named User which has a MANY_TO_ONE association with TestType class.

Finally I have a class named PowerUser that inherits User class. I don’t use in my sample project but the bug won’t reproduce without it… strange.

User entity’s view looks like this:

How to reproduce: When you’ll run my sample project please create a TestClassType entity and then please create a TestType entity linked with it.

Then please create an User. When you hit save this exception is thrown:
ClassCastException: cannot be cast to

Andrei (88.9 KB)

Thank you for reporting the problem. We have created an issue.
As a workaround, in user-view set the fetch type to BATCH or UNDEFINED to the type property.



Thank you for creating an issue and suggesting a workaround for the moment.


1 Like