Return-Path: X-Original-To: apmail-aries-dev-archive@www.apache.org Delivered-To: apmail-aries-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2FBFDE78B for ; Wed, 27 Feb 2013 17:25:13 +0000 (UTC) Received: (qmail 14770 invoked by uid 500); 27 Feb 2013 17:25:12 -0000 Delivered-To: apmail-aries-dev-archive@aries.apache.org Received: (qmail 14619 invoked by uid 500); 27 Feb 2013 17:25:12 -0000 Mailing-List: contact dev-help@aries.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aries.apache.org Delivered-To: mailing list dev@aries.apache.org Received: (qmail 14605 invoked by uid 99); 27 Feb 2013 17:25:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Feb 2013 17:25:12 +0000 Date: Wed, 27 Feb 2013 17:25:12 +0000 (UTC) From: "John Ross (JIRA)" To: dev@aries.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ARIES-1019) JPA weaving hook must be called before proxy weaving hook. 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/ARIES-1019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13588534#comment-13588534 ] John Ross commented on ARIES-1019: ---------------------------------- I also opened https://issues.apache.org/jira/browse/OPENJPA-2342 for openjpa's consideration. > JPA weaving hook must be called before proxy weaving hook. > ---------------------------------------------------------- > > Key: ARIES-1019 > URL: https://issues.apache.org/jira/browse/ARIES-1019 > Project: Aries > Issue Type: Bug > Components: JPA, Proxy > Reporter: John Ross > > Caused by: org.apache.openjpa.util.GeneralException: An error occurred while enhancing itemjpa.ItemJPA. Exception message: java.lang.ClassNotFoundException: org.apache.aries.proxy.weaving.WovenProxy > at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:578) > at org.apache.openjpa.enhance.PCClassFileTransformer.transform0(PCClassFileTransformer.java:153) > at org.apache.openjpa.enhance.PCClassFileTransformer.transform(PCClassFileTransformer.java:126) > at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.transform(PersistenceProviderImpl.java:290) > at org.apache.aries.jpa.container.weaving.impl.WrappingTransformer.transform(WrappingTransformer.java:80) > at org.apache.aries.jpa.container.weaving.impl.JPAWeavingHook.weave(JPAWeavingHook.java:71) > ... 48 more > Caused by: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: org.apache.aries.proxy.weaving.WovenProxy > at serp.util.Strings.toClass(Strings.java:164) > at serp.util.Strings.toClass(Strings.java:108) > at serp.bytecode.BCClass.getDeclaredInterfaceTypes(BCClass.java:740) > at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:537) > ... 53 more > This issue occurs when the Apache Aries Proxy weaving hook gets called before the Apache Aries JPA weaving hook. Proxy weaves the class with the WovenProxy interface and adds the necessary dynamic package imports. JPA then gets called and uses PCEnhancer which, in turn, calls BCClass.getDeclaredInterfaceTypes, which ultimately calls Class.forName using the woven interface's name. The class loader is from the bundle whose class is being woven. Per the OSGi spec, dynamic imports do not take effect until after the entire weaving process is complete. Consequently, the bundle's class loader does not yet have visibility to the class. > One solution would be to ensure that the jpa weaving hook is always called before the proxy weaving hook using the service ranking property. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira