线程中的例外“主” java.lang.stackoverflowerror at org.slf4j.loggerfactory.getlogger(loggerfactory.java:242)

发布于 2025-01-18 06:02:26 字数 1145 浏览 0 评论 0原文

我正在从事一个春季多模块项目。我已将春季版从3.x升级到5.3.17。升级后,运行项目IAM时会出现以下错误: 线程中的异常“ main” java.lang.stackoverflowerror atorg.slf4j.loggerfactory.getlogger(loggerfactory.java:242) at rog.apache.commons.logging.logadapter $ SLF4JADAPTER.CREATELOCATEWARELOG(Logadapter.java:130) at rog.apache.commons.logging.logadapter.createlog(logadapter.java:91) at rog.apache.commons.logging.logfactory.getlog(logfactory.java:67) atorg.slf4j.impl.jclloggerfactory.getlogger(jclloggerfactory.java:88) atorg.slf4j.loggerfactory.getlogger(loggerfactory.java:242) at rog.apache.commons.logging.logadapter $ slf4jadapter.createLocationAwareLog(logadapter.java:130) at rog.apache.commons.logging.logadapter.createlog(logadapter.java:91) at rog.apache.commons.logging.logfactory.getlog(logfactory.java:67) atorg.slf4j.impl.jclloggerfactory.getlogger(jclloggerfactory.java:88)

in Build.gradle file: compile(组:“ org.springframework”,名称:“弹簧核”,版本:“ 3.0.5.release”)。此处版本更改为5.3.17 适用于spring-contept,spring-web等春季相关依赖项的类似内容。

I am working on a spring multi module project. I have upgraded spring version from 3.x to 5.3.17. After upgradation, while running project Iam getting following error:
Exception in thread "main" java.lang.StackOverflowError
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
at org.apache.commons.logging.LogAdapter$Slf4jAdapter.createLocationAwareLog(LogAdapter.java:130)
at org.apache.commons.logging.LogAdapter.createLog(LogAdapter.java:91)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:67)
at org.slf4j.impl.JCLLoggerFactory.getLogger(JCLLoggerFactory.java:88)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
at org.apache.commons.logging.LogAdapter$Slf4jAdapter.createLocationAwareLog(LogAdapter.java:130)
at org.apache.commons.logging.LogAdapter.createLog(LogAdapter.java:91)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:67)
at org.slf4j.impl.JCLLoggerFactory.getLogger(JCLLoggerFactory.java:88)

in build.gradle file:
compile(group: "org.springframework", name: "spring-core", version: "3.0.5.RELEASE").Here version changed to 5.3.17
similar things applied for spring-context,spring-web etc spring related dependencies in build.gradle

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

思慕 2025-01-25 06:02:26

您的 SLF4J 使用 JCL 作为后端,而您的 JCL 使用 SLF4J 作为后端,因此出现了 StackOverflow。

较新版本的 Spring 有 spring-jcl 作为传递依赖,它们将使用 Jakarta Commons Logging 编码的日志记录重定向到 SLF4J。

如果您还有 slf4j-jcl 绑定在执行相反重定向的类路径上,您会收到 StackOverflowException 。

只需从依赖项中删除 slf4j-jcl 就可以了。

Your SLF4J uses JCL as backend and your JCL uses SLF4J as backend, hence the StackOverflow.

Newer versions of Spring have spring-jcl as transitive dependency and they redirect logging coded using Jakarta Commons Logging to SLF4J.

If moreover you have a slf4j-jcl binding on your classpath that performs the opposite redirect, you get a StackOverflowException.

Just remove slf4j-jcl from your dependencies and you should be fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文