aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Ward (JIRA)" <>
Subject [jira] [Commented] (ARIES-681) JPA Container BundleDelegatingClassLoader should look for classes in the provider bundle, too
Date Mon, 20 Jun 2011 10:21:47 GMT


Timothy Ward commented on ARIES-681:


>From what you are saying it seems as though you are not pre-enhancing your entities with
the EclipseLink tools - is this correct?

Assuming you aren't enhancing your entities at build time they must be being enhanced at some
other point to end up referencing IndirectList. Glassfish offers deploy time weaving for OSGi
bundles, which is probably what's causing this problem. This can be disabled by specifying

GlassFish-StaticallyWeaved: true

in the bundle manifest. I think they are doing this deploy-time enhancement, then not adding
the extra dependencies into the bundle manifest, which is then breaking things.

As for whether the EclipseLink team would take this seriously, they're actually pretty OSGi
savvy. In fact EclipseLink was the first properly OSGi compatible JPA provider. I think they
would be very interested to know about this issue.

I am still not convinced that we should be adding the Persistence Provider into the ClassLoader
returned by PersistenceUnitInfo#getClassLoader(). This may solve the issue here, but it causes
many more. The actual persistence bundle doesn't gain any dependency or lifecycle management
this way, and it won't actually allow the bundle to load these classes if they're really needed.
I still think getting EclipseLink and/or GlassFish to look at this is important.



> JPA Container BundleDelegatingClassLoader should look for classes in the provider bundle,
> ---------------------------------------------------------------------------------------------
>                 Key: ARIES-681
>                 URL:
>             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(
> 	at org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.convertClassNamesToClasses(
> 	at org.eclipse.persistence.mappings.CollectionMapping.convertClassNamesToClasses(
> 	at org.eclipse.persistence.descriptors.ClassDescriptor.convertClassNamesToClasses(
> 	at org.eclipse.persistence.sessions.Project.convertClassNamesToClasses(
> 	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(
> 	... 83 more
> Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.indirection.IndirectList
> 	at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(
> 	at org.apache.felix.framework.ModuleImpl.access$100(
> 	at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(
> 	at java.lang.ClassLoader.loadClass(
> 	at org.apache.felix.framework.ModuleImpl.getClassByDelegation(
> 	at org.apache.felix.framework.Felix.loadBundleClass(
> 	at org.apache.felix.framework.BundleImpl.loadClass(
> 	at org.apache.aries.jpa.container.unit.impl.BundleDelegatingClassLoader$
> 	at org.apache.aries.jpa.container.unit.impl.BundleDelegatingClassLoader$
> 	at Method)
> 	at org.apache.aries.jpa.container.unit.impl.BundleDelegatingClassLoader.findClass(
> 	at java.lang.ClassLoader.loadClass(
> 	at java.lang.ClassLoader.loadClass(
> 	at java.lang.Class.forName0(Native Method)
> 	at java.lang.Class.forName(
> 	at
> 	at org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.convertClassNamesToClasses(
> 	... 87 more

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message