簡體   English   中英

遷移到 Java 時出現 Logback 錯誤 11

[英]Logback Error Occurred when Migrating to Java 11

I'm currently migrating from Java 8 to Java 11. I'm using Spring boot 2.2.7 and 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 11 上也遇到了 logback 問題。無論問題是什么,他們似乎已經在 1.3.0 行中修復了它(仍處於 alpha 版本)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM