openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: [jira] [Created] (OPENJPA-2024) IllegalStateException: localized message key: meta-field-not-param
Date Wed, 29 Jun 2011 16:31:36 GMT
> 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, 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 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
a) Is the original persistent domain classes compiled with
-Aopenjpa.metamodel=true option?
b) If yes, please post generated and original
c) If not, what is the origin of ?
d)  If possible, post the original declaration of serialversionUID in its
owning class  

View this message in context:
Sent from the OpenJPA Developers mailing list archive at

View raw message