Bundle org.eclipse.persistence.extension_2.7.0.qualifier.jar
(我安装到osgi框架中的)包含类org.eclipse.persistence.logging.slf4j.SLF4JLogger
。在我的持久化文件中,我有以下配置:
<property name="eclipselink.logging.logger" value="org.eclipse.persistence.logging.slf4j.SLF4JLogger"/>
但是我获得
Exception Description: ClassNotFound: [org.eclipse.persistence.logging.slf4j.SLF4JLogger] specified in [eclipselink.logging.logger] property.
Internal Exception: java.lang.ClassNotFoundException: org.eclipse.persistence.logging.slf4j.SLF4JLogger not found by org.eclipse.persistence.jpa [11]
at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:231)
... 36 more
Caused by: Exception [EclipseLink-28006] (Eclipse Persistence Services - 2.7.0.qualifier): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: ClassNotFound: [org.eclipse.persistence.logging.slf4j.SLF4JLogger] specified in [eclipselink.logging.logger] property.
Internal Exception: java.lang.ClassNotFoundException: org.eclipse.persistence.logging.slf4j.SLF4JLogger not found by org.eclipse.persistence.jpa [11]
at org.eclipse.persistence.exceptions.EntityManagerSetupException.classNotFoundForProperty(EntityManagerSetupException.java:135)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.findClassForPropertyInternal(EntityManagerSetupImpl.java:1341)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.findClassForProperty(EntityManagerSetupImpl.java:1327)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateLoggers(EntityManagerSetupImpl.java:1202)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1752)
... 34 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.logging.slf4j.SLF4JLogger not found by org.eclipse.persistence.jpa [11]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:165)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.findClass(EntityManagerSetupImpl.java:1319)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.findClassForPropertyInternal(EntityManagerSetupImpl.java:1337)
... 37 more
我检查了bundle org.eclipse.persistence.extension_2.7.0.qualifier.jar
,发现它没有导出 org.eclipse.persistence.logging.slf4j
包。所以,请问有人能够解释如何让EclipseLink在slf4j中进行日志记录吗?