I try to persist my Department
and Mandator
classes to hsqhldb but it gives this error.
Exception Description: [class ch.printsoft.
I just spent a lot of time debugging a seemingly unexplainable case of this exception, so I'm just leaving my story here.
If you're using a somewhat old implementation of JPA (e.g. EclipseLink 2.5.x) and you're using modern Java 8 features (such as lambda expressions) in your code base - don't ever use them in the JPA entity classes.
EclipseLink 2.5's class metadata parser crashes upon encountering Java 8 features (such as lambda expressions, method references etc.) in the bytecode. The internal crash is a very unfriendly ArrayIndexOutOfBoundsException
, but you don't even get to see it, as the weaver code silently ignores metadata parser crashes and just assumes the class has no interesting metadata. This leads it to believe that the class in question is not an entity even though it has all the proper annotations, and the end result is the error message we are talking about.
Bottom line: Don't use Java 8 lambdas in JPA entity classes. EVER.