gpt4 book ai didi

java - Akka添加slf4j时出现ClassNotFoundException

转载 作者:行者123 更新时间:2023-12-02 05:55:30 25 4
gpt4 key购买 nike

以下是我在将 slf4j 添加到我的 Akka 项目时得到的错误跟踪。

.....
[DEBUG] [05/07/2019 10:12:00.959] [main] [EventStream] StandardOutLogger started
error while starting up loggers
akka.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]]
.....

您知道如何解决此问题吗?

最佳答案

可以通过向 Akka 项目添加 akka-slf4j 依赖项来解决此问题。

    <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>

NOTE: Make sure your akka-actor and akka-slf4j have the same versions.

关于java - Akka添加slf4j时出现ClassNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56015814/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com