【发布时间】:2023-03-21 00:47:01
【问题描述】:
我在我的一个项目中使用 scala、spray 和 akka。在 Intellij 中,它运行良好。当我构建项目并尝试在命令行中运行它时,出现以下错误。
Caused by: com.typesafe.config.ConfigException$Missing: No configuration setting
found for key 'akka'
at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:124)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:147)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:159)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:164)
at com.typesafe.config.impl.SimpleConfig.getString(SimpleConfig.java:206)
at akka.actor.ActorSystem$Settings.(ActorSystem.scala:168)
at akka.actor.ActorSystemImpl.(ActorSystem.scala:504)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:141)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:108)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:99)
请帮我解决问题
【问题讨论】:
-
你需要在你的conf文件中为akka提供配置……就这么简单。
-
我理解...我使用的是默认配置。在 ide 它工作正常..
-
那么可能和你在命令行运行的方式有关。你是如何运行它的?
-
这是因为当我们将项目构建为单个 jar 时,reference.conf 文件将被覆盖。我们必须将所有 jars reference.conf 复制到单个 reference.conf。它会正常工作...:-)