com.typesafe.config.ConfigException$Missing:reference.conf:未找到键 'default' 的配置设置
com.typesafe.config.ConfigException$Missing: reference.conf: No configuration setting found for key 'default'
我创建了我的 Akka 应用程序的 jar 文件。当我通过命令 运行 jar 文件时
java -jar file.jar
然后我看到这个错误。可能出了什么问题,我该如何解决?
[ERROR] [04/28/2022 14:11:03.296] [main] [KnowledgePortalRest(akka://knowledge-portal-actor-system)] Error starting application:
com.typesafe.config.ConfigException$Missing: reference.conf @ jar:file:/home/knoldus/knolx-service/target/scala-2.12/sbt-1.0/knowledge-portal-rest-assembly-2.2.1.jar!/reference.conf: 13-1466: No configuration setting found for key 'default'
at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:156)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:174)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:188)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:193)
at com.typesafe.config.impl.SimpleConfig.getBoolean(SimpleConfig.java:218)
at com.typesafe.sslconfig.util.ConfigLoader$.$anonfun$booleanLoader(Configuration.scala:186)
at com.typesafe.sslconfig.util.ConfigLoader$.$anonfun$booleanLoader$adapted(Configuration.scala:186)
at com.typesafe.sslconfig.util.ConfigLoader$$anon.load(Configuration.scala:173)
at com.typesafe.sslconfig.util.EnrichedConfig.get(Configuration.scala:22)
at com.typesafe.sslconfig.ssl.SSLConfigParser.parse(Config.scala:498)
at com.typesafe.sslconfig.ssl.SSLConfigFactory$.parse(Config.scala:486)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.defaultSSLConfigSettings(AkkaSSLConfig.scala:34)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.createExtension(AkkaSSLConfig.scala:29)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.createExtension(AkkaSSLConfig.scala:19)
at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:1006)
at akka.actor.ExtensionId.apply(Extension.scala:79)
at akka.actor.ExtensionId.apply$(Extension.scala:78)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.apply(AkkaSSLConfig.scala:24)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.apply(AkkaSSLConfig.scala:19)
at akka.http.scaladsl.HttpExt.<init>(Http.scala:82)
at akka.http.scaladsl.Http$.createExtension(Http.scala:1132)
at akka.http.scaladsl.Http$.createExtension(Http.scala:901)
at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:1006)
at akka.actor.ExtensionId.apply(Extension.scala:79)
at akka.actor.ExtensionId.apply$(Extension.scala:78)
at akka.http.scaladsl.Http$.apply(Http.scala:1127)
at com.knoldus.HttpServer.start(HttpServer.scala:28)
at com.knoldus.HttpServerApp$.delayedEndpoint$com$knoldus$HttpServerApp(HttpServerApp.scala:70)
at com.knoldus.HttpServerApp$delayedInit$body.apply(HttpServerApp.scala:24)
at scala.Function0.apply$mcV$sp(Function0.scala:39)
at scala.Function0.apply$mcV$sp$(Function0.scala:39)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
at scala.App.$anonfun$main$adapted(App.scala:80)
at scala.collection.immutable.List.foreach(List.scala:392)
at scala.App.main(App.scala:80)
at scala.App.main$(App.scala:78)
at com.knoldus.HttpServerApp$.main(HttpServerApp.scala:24)
at com.knoldus.HttpServerApp.main(HttpServerApp.scala)
当应用程序无法在类路径中找到 reference.conf
配置文件时,会发生这种错误。
确保您构建的 jar 中存在此类文件。
我创建了我的 Akka 应用程序的 jar 文件。当我通过命令 运行 jar 文件时
java -jar file.jar
然后我看到这个错误。可能出了什么问题,我该如何解决?
[ERROR] [04/28/2022 14:11:03.296] [main] [KnowledgePortalRest(akka://knowledge-portal-actor-system)] Error starting application:
com.typesafe.config.ConfigException$Missing: reference.conf @ jar:file:/home/knoldus/knolx-service/target/scala-2.12/sbt-1.0/knowledge-portal-rest-assembly-2.2.1.jar!/reference.conf: 13-1466: No configuration setting found for key 'default'
at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:156)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:174)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:188)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:193)
at com.typesafe.config.impl.SimpleConfig.getBoolean(SimpleConfig.java:218)
at com.typesafe.sslconfig.util.ConfigLoader$.$anonfun$booleanLoader(Configuration.scala:186)
at com.typesafe.sslconfig.util.ConfigLoader$.$anonfun$booleanLoader$adapted(Configuration.scala:186)
at com.typesafe.sslconfig.util.ConfigLoader$$anon.load(Configuration.scala:173)
at com.typesafe.sslconfig.util.EnrichedConfig.get(Configuration.scala:22)
at com.typesafe.sslconfig.ssl.SSLConfigParser.parse(Config.scala:498)
at com.typesafe.sslconfig.ssl.SSLConfigFactory$.parse(Config.scala:486)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.defaultSSLConfigSettings(AkkaSSLConfig.scala:34)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.createExtension(AkkaSSLConfig.scala:29)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.createExtension(AkkaSSLConfig.scala:19)
at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:1006)
at akka.actor.ExtensionId.apply(Extension.scala:79)
at akka.actor.ExtensionId.apply$(Extension.scala:78)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.apply(AkkaSSLConfig.scala:24)
at com.typesafe.sslconfig.akka.AkkaSSLConfig$.apply(AkkaSSLConfig.scala:19)
at akka.http.scaladsl.HttpExt.<init>(Http.scala:82)
at akka.http.scaladsl.Http$.createExtension(Http.scala:1132)
at akka.http.scaladsl.Http$.createExtension(Http.scala:901)
at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:1006)
at akka.actor.ExtensionId.apply(Extension.scala:79)
at akka.actor.ExtensionId.apply$(Extension.scala:78)
at akka.http.scaladsl.Http$.apply(Http.scala:1127)
at com.knoldus.HttpServer.start(HttpServer.scala:28)
at com.knoldus.HttpServerApp$.delayedEndpoint$com$knoldus$HttpServerApp(HttpServerApp.scala:70)
at com.knoldus.HttpServerApp$delayedInit$body.apply(HttpServerApp.scala:24)
at scala.Function0.apply$mcV$sp(Function0.scala:39)
at scala.Function0.apply$mcV$sp$(Function0.scala:39)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
at scala.App.$anonfun$main$adapted(App.scala:80)
at scala.collection.immutable.List.foreach(List.scala:392)
at scala.App.main(App.scala:80)
at scala.App.main$(App.scala:78)
at com.knoldus.HttpServerApp$.main(HttpServerApp.scala:24)
at com.knoldus.HttpServerApp.main(HttpServerApp.scala)
当应用程序无法在类路径中找到 reference.conf
配置文件时,会发生这种错误。
确保您构建的 jar 中存在此类文件。