我正在使用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)
请帮我解决这个问题
小智 51
问题是当使用sbt:assembly时,默认合并策略会排除所有reference.conf文件
如果多个文件共享相同的相对路径(例如,多个依赖项JAR中名为application.conf的资源),则默认策略是验证所有候选项具有相同的内容,否则出错.
解决方案是按如下方式添加MergeStrategy
assemblyMergeStrategy in assembly := {
case PathList("reference.conf") => MergeStrategy.concat
}
Run Code Online (Sandbox Code Playgroud)