I'm trying to enable JavaLog with EclipseLink and have therefore defined the following property in my persistence.xml:
<property name="eclipselink.logging.logger" value="JavaLogger"/>
The persistence unit will not start due to the following error:
javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [projectcontrolling] failed.
Internal Exception: Exception [EclipseLink-28006] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: ClassNotFound: [org.eclipse.persistence.logging.JavaLog] specified in [eclipselink.logging.logger] property.
Internal Exception: java.lang.ClassNotFoundException: org/eclipse/persistence/logging/JavaLog
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:1541)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1532)
The error originates from this call:
Class.forName(className, initialize, loader);
where loader is an instance of org.eclipse.gemini.jpa.classloader.CompositeClassLoader. The gemini debugging log says:
Attempting loadClass(org.eclipse.persistence.logging.JavaLog) on org.eclipse.gemini.jpa.classloader.BundleProxyClassLoader@5f0275fa(ch.arenae.projectcontrolling.domain)
Bundle has no classloader so loadClass(org.eclipse.persistence.logging.JavaLog) is returning null
What happens is that the CompositeClassLoader first delgates to the the BundleProxyClassLoader of the persistence bundle. The persistence bundle is in this moment in state INSTALLED. BundleProxyClassLoader returns null and the CompositeClassLoader stops looking for the class.
Would it not be better in BundleProxyClassLoader to throw a ClassNotFoundException when the bundle is not resolved?
I'm using Gemini JPA 1.1.0 and Eclipselink 2.4.1.
Regards,
Peter