In my application, an "AuditReader reader" is declared.
At some point, I'm trying to retrieve a BO with the method reader.find(MyBO.class, id, lastRevision).
The thing is, this method throws a java.lang.IllegalArgumentException, the detailMessage being "myBOenum is not an enum type".
The main information I can provide is that this code hasn't been touched and was working perfectly with Hibernate 4, but it now throws this error if I switch to Hibernate 5. Reversing to Hibernate 4 solves the issue.
Any idea what's wrong and how to fix this issue?
Edit: it seems that I have random errors... Maybe something about multi-threading? Here is one stacktrace I keep having now:
Caused by: java.lang.IllegalStateException: This web container has not yet been started
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1674)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633)
at sun.misc.Unsafe.defineClass(Native Method)
at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393)
at sun.reflect.MethodAccessorGenerator.generateMethod(MethodAccessorGenerator.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:53)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.lang.Class.getEnumConstantsShared(Class.java:3320)
at java.lang.Class.enumConstantDirectory(Class.java:3341)
at java.lang.Enum.valueOf(Enum.java:232)
I have Java 8 update 161. I've also found some similar issues I believe like here https://hibernate.atlassian.net/browse/HHH-12396 But I couldn't get a solution from that page