gpt4 book ai didi

java - EclipseLink:如何为 eclipselink 2.7.0 设置 SLF4J 记录器

转载 作者:行者123 更新时间:2023-12-05 07:44:05 26 4
gpt4 key购买 nike

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

我检查过包 org.eclipse.persistence.extension_2.7.0.qualifier.jar 不导出包 org.eclipse.persistence.logging.slf4j 所以,谁能解释一下如何使eclipselink登录slf4j?

最佳答案

确保包含“org.eclipse.persistence.extension”jar,它应该可以正常工作。我使用的 Maven 坐标是

  <dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.extension</artifactId>
<version>2.7.2</version>
<scope>runtime</scope>
</dependency>

关于java - EclipseLink:如何为 eclipselink 2.7.0 设置 SLF4J 记录器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43146950/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com