I just spent a lot of time debugging the seemingly inexplicable case of this exception, so I just leave my story here.
If you use a somewhat old implementation of JPA (for example, EclipseLink 2.5.x), and you use modern Java 8 functions (for example, lambda expressions) in your code base, you should never use them in JPA entity classes.
The EclipseLink 2.5 class metadata parser crashes when it encounters Java 8 functions (such as lambda expressions, method references, etc.) in bytecode. The internal failure is a very unfriendly ArrayIndexOutOfBoundsException
, but you don’t even see it, because the weaver code silently ignores the metadata parser failures and simply assumes that the class does not contain interesting metadata. This leads us to believe that the class in question is not an entity, although it has all the relevant annotations, and the end result is the error message that we are talking about.
Bottom line: Do not use Java 8 iambda in JPA entity classes. EVER.
kFYatek
source share