[
https://issues.apache.org/jira/browse/ARIES-681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051161#comment-13051161
]
Timothy Ward commented on ARIES-681:
------------------------------------
Hi
I'm not quite sure from this bug what the underlying problem is.
If the JPA provider is trying to use the application classloader to load its
internal implementation classes then that is a bug in the JPA provider, not the
JPA container. The JPA Provider should not assume that its internals are
available on the persistence bundle's classloader, only on its own.
If org.eclipse.persistence.indirection.IndirectList is a package that gets
added by enhancement then this is a different story. If the classes have been
pre-enhanced then the dependencies added by the enhancer need to be added to
the bundle manifest. If the enhancement is at load-time then "something" in the
runtime needs to add the dependency. In trunk this behaviour is seen on 4.3
core frameworks when we add extra dynamic imports using a WeavingHook.
If something else is happening then I'm afraid I don't know what it is and I
could do with some extra context!
Tim
> JPA Container BundleDelegatingClassLoader should look for classes in the
> provider bundle, too
> ---------------------------------------------------------------------------------------------
>
> Key: ARIES-681
> URL: https://issues.apache.org/jira/browse/ARIES-681
> Project: Aries
> Issue Type: Bug
> Components: JPA
> Affects Versions: 0.3
> Environment: Glassfish 3.0 (EclipseLink 2.0.2), Glassfish 3.1
> (EclipseLink 2.2)
> Reporter: Balazs Zsoldos
> Attachments: classloadingFromMultipleProviderDuringQuery.0.3.patch
>
>
> Currently the BundleDelegatingClassLoader in JPA container only looks for
> classes in the bundle of the entitymanager. However the JPA implementation
> Eclipselink needs some classes from itself. The reason is that in entity
> classes the properties that hold mapping of One-To-Many are converted to
> EclipseLink list type. See the following exception stacktrace:
> Internal Exception: java.lang.ClassNotFoundException:
> org.eclipse.persistence.indirection.IndirectList
> at
> org.eclipse.persistence.exceptions.ValidationException.classNotFoundWhileConvertingClassNames(ValidationException.java:2317)
> at
> org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.convertClassNamesToClasses(InterfaceContainerPolicy.java:123)
> at
> org.eclipse.persistence.mappings.CollectionMapping.convertClassNamesToClasses(CollectionMapping.java:788)
> at
> org.eclipse.persistence.descriptors.ClassDescriptor.convertClassNamesToClasses(ClassDescriptor.java:1458)
> at
> org.eclipse.persistence.sessions.Project.convertClassNamesToClasses(Project.java:362)
> at
> org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:322)
> ... 83 more
> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.persistence.indirection.IndirectList
> at
> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:744)
> at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:61)
> at
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1656)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at
> org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:604)
> at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1487)
> at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:897)
> at
> org.apache.aries.jpa.container.unit.impl.BundleDelegatingClassLoader$1.run(BundleDelegatingClassLoader.java:50)
> at
> org.apache.aries.jpa.container.unit.impl.BundleDelegatingClassLoader$1.run(BundleDelegatingClassLoader.java:47)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.aries.jpa.container.unit.impl.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:47)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
> at
> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:88)
> at
> org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.convertClassNamesToClasses(InterfaceContainerPolicy.java:120)
> ... 87 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira