You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Dominik Przybysz (Jira)" <ji...@apache.org> on 2026/09/20 22:35:00 UTC
[jira] [Closed] (ARIES-1019) JPA weaving hook must be called before proxy weaving hook.
[ https://issues.apache.org/jira/browse/ARIES-1019?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dominik Przybysz closed ARIES-1019.
-----------------------------------
Closing for released artifact
> 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
> Assignee: John Ross
> Priority: Major
> Attachments: aries1019.patch
>
>
> Caused by: <openjpa-2.2.2-SNAPSHOT-r422266:1446295 nonfatal general error> 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 was sent by Atlassian Jira
(v8.20.10#820010)