Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 44300 invoked from network); 19 Nov 2010 09:56:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 Nov 2010 09:56:04 -0000 Received: (qmail 79093 invoked by uid 500); 19 Nov 2010 09:56:36 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 78928 invoked by uid 500); 19 Nov 2010 09:56:35 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 78920 invoked by uid 99); 19 Nov 2010 09:56:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Nov 2010 09:56:34 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Nov 2010 09:56:34 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oAJ9uDTH013216 for ; Fri, 19 Nov 2010 09:56:14 GMT Message-ID: <30809279.193821290160573962.JavaMail.jira@thor> Date: Fri, 19 Nov 2010 04:56:13 -0500 (EST) From: "Xavi Arias (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-1891) PCEnhancer does not find meta data for entities using annotations In-Reply-To: <5112937.178291290101533300.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-1891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933755#action_12933755 ] Xavi Arias commented on OPENJPA-1891: ------------------------------------- The is only one jar in the classpath containing javax.persistence.Entity, that is geronimo-jpa_3.0_spec-1.0.jar. > PCEnhancer does not find meta data for entities using annotations > ----------------------------------------------------------------- > > Key: OPENJPA-1891 > URL: https://issues.apache.org/jira/browse/OPENJPA-1891 > 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 mechanism. > 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.