gpt4 book ai didi

akka - com.typesafe.config.ConfigException$ 缺少 : No configuration setting found for key 'akka.stream'

转载 作者:行者123 更新时间:2023-12-04 21:33:07 39 4
gpt4 key购买 nike

我正在尝试运行 akka 流应用程序,但出现异常:

No configuration setting found for key 'akka.stream'

相关的代码片段是:
ConfigFactory.load()
implicit val system = ActorSystem("svc")
implicit val mat = ActorMaterializer()

我尝试了两个命令行:
java -jar ./myService.jar -Dconfig.resource=/opt/myservice/conf/application.conf
java -jar ./myService.jar -Dconfig.file=/opt/myService/conf/application.conf

我的 application.conf 文件:
akka {
event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
loglevel = "DEBUG"
actor {
}

stream {

# Default materializer settings
materializer {
max-input-buffer-size = 16
dispatcher = ""
subscription-timeout {
mode = cancel
timeout = 5s
}

output-burst-limit = 1000
auto-fusing = on
max-fixed-buffer-size = 1000000000
sync-processing-limit = 1000
}

blocking-io-dispatcher = "akka.stream.default-blocking-io-dispatcher"

default-blocking-io-dispatcher {
type = "Dispatcher"
executor = "thread-pool-executor"
throughput = 1

thread-pool-executor {
fixed-pool-size = 16
}
}
}
}

异常详情:
No configuration setting found for key 'akka.stream'
at
com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:152)
at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:145)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:172)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:176)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:184)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)
at com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:258)
at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:264)
at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:37)
at akka.stream.ActorMaterializerSettings$.apply(ActorMaterializer.scala:248)
at akka.stream.ActorMaterializer$$anonfun$1.apply(ActorMaterializer.scala:41)
at akka.stream.ActorMaterializer$$anonfun$1.apply(ActorMaterializer.scala:41)
at scala.Option.getOrElse(Option.scala:121)
at akka.stream.ActorMaterializer$.apply(ActorMaterializer.scala:41)
at com.Listener$.main(Listener.scala:41)
at com.Listener.main(Listener.scala)

你能帮忙吗?

谢谢

最佳答案

要从文件加载配置,您应该使用:
-Dconfig.file=/opt/myService/conf/application.conf
文档链接:https://github.com/typesafehub/config#standard-behavior

关于akka - com.typesafe.config.ConfigException$ 缺少 : No configuration setting found for key 'akka.stream' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46178035/

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