Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6B545108E6 for ; Wed, 25 Sep 2013 15:17:27 +0000 (UTC) Received: (qmail 93045 invoked by uid 500); 25 Sep 2013 15:17:26 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 92980 invoked by uid 500); 25 Sep 2013 15:17:26 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 92962 invoked by uid 99); 25 Sep 2013 15:17:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Sep 2013 15:17:25 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dikonoor@in.ibm.com designates 202.81.31.143 as permitted sender) Received: from [202.81.31.143] (HELO e23smtp01.au.ibm.com) (202.81.31.143) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Sep 2013 15:17:15 +0000 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 26 Sep 2013 01:16:52 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 26 Sep 2013 01:16:49 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id EF5AC2BB0052; Thu, 26 Sep 2013 01:16:48 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r8PFGbqq3866936; Thu, 26 Sep 2013 01:16:37 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r8PFGmXc028738; Thu, 26 Sep 2013 01:16:48 +1000 Received: from d23ml069.in.ibm.com (d23ml069.in.ibm.com [9.182.8.64]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r8PFGla5028734; Thu, 26 Sep 2013 01:16:47 +1000 Subject: RE: Entitiy not enhanced X-KeepSent: 93586E6D:8EB3651D-65257BF1:0053E97E; type=4; name=$KeepSent To: users@openjpa.apache.org, dev@openjpa.apache.org X-Mailer: Lotus Notes Release 8.5.3FP4 SHF39 May 13, 2013 Message-ID: From: Divya K Konoor Date: Wed, 25 Sep 2013 20:45:04 +0530 X-MIMETrack: Serialize by Router on d23ml069/23/M/IBM(Release 8.5.3FP2HF29 | July 24, 2012) at 25/09/2013 20:45:06 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13092515-1618-0000-0000-000004B035F9 X-Virus-Checked: Checked by ClamAV on apache.org Hi, I tried by manually adding the java agent in my jvm options -javaagent:/ apache-openjpa-2.2.2/lib/openjpa-all-2.2.2.jar following examples 5.2 and 5.3 under section 2.3 at http://openjpa.apache.org/builds/2.1.1/apache-openjpa/docs/ref_guide_pc_enhance.html#ref_guide_pc_enhance_build . But even that hasn't helped .I still get the entity not enhanced problem. Regards Divya From: Divya K Konoor/India/IBM To: users-help@openjpa.apache.org, dev-help@openjpa.apache.org, Date: 09/25/2013 07:19 PM Subject: Entitiy not enhanced Hi, I use a container (Webshphere liberty that internally uses openjpa). I have multiple OSGi persistence bundles .Each has its own persistence unit ; all of these talk to the same database.The JPA entities bundled within each persistence bundle is defined under the tag of the persistence.xml. Some of these entities have relationship or dependency on the entities bundled with another persistence bundle in which case the dependent entities are added in the tag of the former's persistence.xml I see the following error message when I start my liberty server: This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: " [err] org.apache.openjpa.persistence.ArgumentException: The type "class com.xxx.ProbeConfiguration" has not been enhanced. [err] at org.apache.openjpa.meta.ClassMetaData.resolveMeta (ClassMetaData.java:1827) [err] at org.apache.openjpa.meta.ClassMetaData.resolve (ClassMetaData.java:1801) [err] at org.apache.openjpa.meta.MetaDataRepository.processBuffer (MetaDataRepository.java:826) [err] at org.apache.openjpa.meta.MetaDataRepository.resolveMeta (MetaDataRepository.java:723) [err] at org.apache.openjpa.meta.MetaDataRepository.resolve (MetaDataRepository.java:647) [err] at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal (MetaDataRepository.java:415) [err] at org.apache.openjpa.meta.MetaDataRepository.getMetaData (MetaDataRepository.java:388) [err] at org.apache.openjpa.meta.MetaDataRepository.resolveAll (MetaDataRepository.java:1990) [err] at org.apache.openjpa.meta.MetaDataRepository.getQueryMetaDataInternal (MetaDataRepository.java:1968) [err] at org.apache.openjpa.meta.MetaDataRepository.getQueryMetaData (MetaDataRepository.java:1955) [err] at org.apache.openjpa.persistence.EntityManagerImpl.createNamedQuery (EntityManagerImpl.java:102 There is a brief mention of this here (but it doesn't explain why): http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=%2Fcom.ibm.websphere.ejbfep.multiplatform.doc%2Finfo%2Fae%2Fae%2Ftejb_jpatroubleshoot.html I was under the impression that openjpa does runtime enhancement on all JPA entities that have not been enhanced. The above log statement seems to indicate that one or more JPA entities have not been enhanced during runtime.I saw a brief mention about this at http://openjpa.apache.org/builds/2.1.1/apache-openjpa/docs/ref_guide_pc_enhance.html#ref_guide_pc_enhance_dynamic "If a javaagent is not provided via the command line and OpenJPA is running on the Sun 1.6 SDK or IBM 1.6 JDK (SR8+), OpenJPA will attempt to dynamically load the Enhancer that was mentioned in the previous section. This support is provided as an ease of use feature and it is not recommended for use in a production system. Using this method of enhancement has the following caveats: The dynamic runtime enhancer is plugged into the JVM during creation of the EntityManagerFactory. Any Entity classes that are loaded before the EntityManagerFactory is created will not be enhanced. " I also noticed the following in the logs: openjpa.DynamicEnhancementAgent: false . I was expecting it to me openjpa.DynamicEnhancementAgent: true . I manually added the following jvm option -Dopenjpa.DynamicEnhancementAgent=true after which the logs show openjpa.DynamicEnhancementAgent: true but I hit the same entitiy not enhanced issue. Apart from build time enhancement , is there anything that can be done to ensure that all JPA entities are enhanced during runtime. Thanks Divya