aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Balazs Zsoldos (JIRA)" <>
Subject [jira] [Commented] (ARIES-681) JPA Container BundleDelegatingClassLoader should look for classes in the provider bundle, too
Date Mon, 04 Jul 2011 15:52:22 GMT


Balazs Zsoldos commented on ARIES-681:


I will upload a sample application soon that will show my problem. I do not use the OSGI capabilities
of EclipseLink due to the following reason:
- I would like to use aries blueprint and jpa:context tag.
- I am afraid that if I use the standard Eclipselink solution (persistence.xml into META-INF
library) I will face many problems with transaction management and aries blueprint

So my solution was that I defined the "Meta-Persistence" in the manifest header. As EclipseLink
does not register the PersistenceProvider as an OSGI service (Aries needs it based on the
OSGI 4.2 specification I think) I created a jar file that does nothing else but the service

I tried to register the osgi based PersistenceProvider of EclipseLink but I got an exception
that createContainerEntityManagerFactory function cannot be called in an OSGI environment
(Aries JPA container calls it). Due to this reason I registered the ordinary PersistenceProvider
of EclipseLink and that is where this "bug" came from. Aries JPA container uses ordinary Eclipselink
persistence provider. Aries creates the Persistence Unit as well, Eclipselink does not do
anything automatically.


> 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