Hi, > Or can you provide some additional information about the cause of this > exception?
The exception is caused when fields of a metamodel class are being assigned a value. The metamodel classes are generated as source code during compilation with a specialized annotation processor. The generated source declares a set of static fields whose types are javax.persistence.meamodel.Attribute. This mechanics is to address the lack of type literals in Java language. At runtime, metamodel is instantiated and values are assigned to its fields. The breakage you are seeing is during this assignment process. OpenJPA code is seeing a field named 'serialVersionUID' in com.foo.Baz_, expecting its type to be javax.persistence.meamodel.Attribute (or its subtype) and getting very confused because it is not. If the weaving process synthesizes a serialVersionUID field to every class, then one option for the process to be aware of these metamodel classes and ignore them from being weaved. The signature carries a @javax.persistence.meamodel.StaticMetamodel annotation for the weaving process to identify them. So, introduction of a new synthetic field in com.foo.Baz_ has essentially turned it into a 'non-canonical' metamodel class. The JPA spec has allowed non-canonical metamodel classes, but been explicit about the vendors not supporting it. The other option is OpenJPA be aware of such synthetic field and ignore them during population of metamodel. I think that is possible especially for a field as typical as serialVersionUID. To help me to understand the problem better, please elaborate/answer the following: a) Is the original persistent domain classes compiled with -Aopenjpa.metamodel=true option? b) If yes, please post generated com.foo.Baz_.java and original com.foo.Baz.java. c) If not, what is the origin of com.foo.Baz_ ? d) If possible, post the original declaration of serialversionUID in its owning class ----- Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/jira-Created-OPENJPA-2024-IllegalStateException-localized-message-key-meta-field-not-param-tp6527720p6529735.html Sent from the OpenJPA Developers mailing list archive at Nabble.com.
