當(dāng)前位置:首頁(yè) > IT技術(shù) > 移動(dòng)平臺(tái) > 正文

開(kāi)發(fā)中遇到的問(wèn)題---【ERROR in ch.qos.logback.core.joran.spi.Interpreter@49:40 - no applicable act】
2022-08-30 00:00:22

問(wèn)題:本地可以正常啟動(dòng),但是在測(cè)試環(huán)境,把a(bǔ)pplication.yml放到bin目錄下,用腳本啟動(dòng)就會(huì)啟動(dòng)不了,報(bào)錯(cuò):“ERROR in ch.qos.logback.core.joran.spi.Interpreter@49:40 - no applicable act”;

分析:我項(xiàng)目要求用log4j2,日志引入和自帶的logback沖突導(dǎo)致,導(dǎo)致啟動(dòng)的時(shí)候,無(wú)法確定按誰(shuí)的規(guī)則去讀配置文件了。

方案:在pom.xml文件中引入下面的依賴;

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<artifactId>logback-core</artifactId>
<groupId>ch.qos.logback</groupId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

?

本文摘自 :https://blog.51cto.com/u

開(kāi)通會(huì)員,享受整站包年服務(wù)立即開(kāi)通 >