openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xavi Arias (JIRA)" <>
Subject [jira] Commented: (OPENJPA-1891) PCEnhancer does not find meta data for entities using annotations
Date Fri, 26 Nov 2010 17:59:13 GMT


Xavi Arias commented on OPENJPA-1891:

I have found a way to avoid this problem, and is to move the geronimo-jpa_3.0_spec-1.0.jar
to the Tomcat lib folder, outside the webapp.

However there is a ClassNotFound exception for some of the enities, but the class not found
is undetermined.

> PCEnhancer does not find meta data for entities using annotations
> -----------------------------------------------------------------
>                 Key: OPENJPA-1891
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: Enhance
>    Affects Versions: 1.2.2
>         Environment: Windows XP SP2
> Spring 2.5.6
> Tomcat 6.0.28
>            Reporter: Xavi Arias
>            Priority: Minor
> The problem comes while enhancing entities at runtime by the Spring load time weaver
> Spring load time weaver is configured with "org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver"
and Tomcat webapp class loader with "org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader".
Everything works without any exception, but the enhancer does not find any entity meta data.
The log message for every entity is the following:
> 18:09:24,431 WARN  openjpa.Enhance - Type "class model.Contact" has no metadata; enhancing
as persistence aware. If you intended for "class model.Contact" to be persistence-capable,
then this means that OpenJPA could not find any metadata for "class model.Contact". This can
happen if the directory containing your metadata is not in your CLASSPATH, or if your metadata
files are not named properly. See the documentation on metadata placement for more information.
> After debugging, that the problem seems to come from the method parseClassAnnotations
in AnnotationPersistenceMetaDataParser. The call to J2DoPriv5Helper.isAnnotationPresentAction(_cls,
Entity.class) always return false, while the class is actually annotated as an entity. This
is because the javax.persistence.Entity class passed as parameter is not the same as the one
in the entity class annotation map, so the subsequent call to getAnnotation(Entity.class)
always returns null.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message