【问题标题】:Logback Error Occurred when Migrating to Java 11迁移到 Java 11 时发生 Logback 错误
【发布时间】:2020-06-18 16:20:28
【问题描述】:

我目前正在从 Java 8 迁移到 Java 11。我正在使用 Spring boot 2.2.7 和 Maven 3.6.1。我能够完美地构建我的项目而没有错误,但是当我尝试启动我的应用程序时,它会引发 logback 错误:

23:54:33,407 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
23:54:33,408 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
23:54:33,408 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/C:/workspace/applicationtest/target/classes/logback.xml]
23:54:33,410 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
23:54:33,410 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/rock/.m2/repository/net/sourceforge/tess4j/tess4j/3.2.1/tess4j-3.2.1.jar!/logback.xml]
23:54:33,410 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [file:/C:/workspace/applicationtest/target/classes/logback.xml]
23:54:33,509 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
23:54:33,517 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@5:38 - no applicable action for [springProperty], current ElementPath  is [[configuration][springProperty]]
23:54:33,517 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@7:30 - no applicable action for [springProfile], current ElementPath  is [[configuration][springProfile]]
23:54:33,517 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:58 - no applicable action for [springProperty], current ElementPath  is [[configuration][springProfile][springProperty]]

这是我的 pom.xml 的日志记录部分

<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
    <scope>runtime</scope>
    <optional>true</optional>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>

当我还在使用 Java 8 时,它工作得很好。我也尝试过排除 logback,但仍然没有运气。我使用的 jre 是使用 jlink 生成的。

关于如何解决此问题的任何建议?

【问题讨论】:

    标签: java spring-boot log4j logback


    【解决方案1】:

    在 Java 11 上也遇到了 logback 问题。不管是什么问题,他们似乎已经在 1.3.0 行中修复了它(仍处于 alpha 版本)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-26
      • 2012-04-10
      • 2021-09-13
      • 2020-12-26
      • 2021-12-15
      • 2022-08-05
      • 2019-02-10
      • 1970-01-01
      相关资源
      最近更新 更多