以下是我在將 slf4j 添加到我的 Akka 項目時得到的錯誤跟蹤。.....[DEBUG] [05/07/2019 10:12:00.959] [main] [EventStream] StandardOutLogger startederror while starting up loggersakka.ConfigurationException: Logger specified in config can't be loaded [akka.event.slf4j.Slf4jLogger] due to [java.lang.ClassNotFoundException: akka.event.slf4j.Slf4jLogger].....Caused by: java.lang.ClassNotFoundException: akka.event.slf4j.Slf4jLogger.....Exception in thread "main" akka.ConfigurationException: Could not start logger due to [akka.ConfigurationException: Logger specified in config can't be loaded [akka.event.slf4j.Slf4jLogger] due to [java.lang.ClassNotFoundException: akka.event.slf4j.Slf4jLogger]].....關于如何解決這個問題的任何想法?
1 回答

富國滬深
TA貢獻1790條經驗 獲得超9個贊
可以通過將akka-slf4j依賴項添加到您的 Akka 項目來解決此問題。
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.12</artifactId>
<version>2.5.22</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-slf4j_2.12</artifactId>
<version>2.5.22</version>
</dependency>
注意:確保您的akka-actor和akka-slf4j具有相同的版本。
添加回答
舉報
0/150
提交
取消