Home > Net >  com.typesafe.config.ConfigException$Missing: reference.conf: No configuration setting found for key
com.typesafe.config.ConfigException$Missing: reference.conf: No configuration setting found for key

Time:04-29

I created a jar file of my Akka application. When I run the jar file by the command

java -jar file.jar

then I see this error. What could be possibly wrong and how can I fix this?

[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$2(Configuration.scala:186)
    at com.typesafe.sslconfig.util.ConfigLoader$.$anonfun$booleanLoader$2$adapted(Configuration.scala:186)
    at com.typesafe.sslconfig.util.ConfigLoader$$anon$2.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$1(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$1$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)

CodePudding user response:

This kind of error happens when the application is unable to found the reference.conf configuration file in the classpath.

Make sure such file is present in the jar you've built.

  • Related