ObjectDB ObjectDB

Error in reading Enum in JPA - Failed to read using reflection

#1

I have created a very simple Entity User which has an enum Status (INACTIVE, ACTIVE).

When an entity User is created, everything looks OK and I have seen on explorer that User is created as expected with valid values of Status. This is all done with JPA/EJBs.

However, at the time of reading the Object (findById), the system throws an error 

com.objectdb.o.UserException: Failed to read the value of field com.xxx.User.status using reflection

caused by..

java.lang.IllegalArgumentException: com.xxx.Status is not an enum type
edit
delete
#2

Please check your enum definition. It should be ordinary enum with no annotations (such as @Entity).

If you cannot see anything wrong, please submit a small test case that demonstrates the problem (using the template on the posting instructions page).

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.