简体   繁体   中英

Akka: unable to read configuration in karaf

I am using Akka actors for Remote communication in karaf.

When I deploy the jar file generated after compiling using maven, I get the following error:

Exception in thread "Thread-113" com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka.version' at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:152) at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:170) 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.getString(SimpleConfig.java:246) at akka.actor.ActorSystem$Settings.(ActorSystem.scala:168) at akka.actor.ActorSystemImpl.(ActorSystem.scala:522) at akka.actor.ActorSystem$.apply(ActorSystem.scala:142) at akka.actor.ActorSystem$.apply(ActorSystem.scala:119) at org.opendaylight.com.test.rem$$anon$1.run(rem.scala:19)

I even added Maven shade plugin in the pom file which was suggested in other answers, but adding the plugin makes all the karaf features to change to ''Resolved'' state. The configuration file for akka is in the classpath too. As of my knowledge, the akka configuration file is not being read at all, as I got the same exception even after removing the configuration file.

This error is most often caused by combining multiple Akka jars into a single super-jar and not handling the reference.conf files correctly. The reference.conf file in each of the Akka module jar-files needs to be concatenated into a single file in the super jar.

Follow the instructions in the docs here: https://doc.akka.io/docs/akka/current/scala/general/configuration.html#when-using-jarjar-onejar-assembly-or-any-jar-bundler

And then verify that the jar-file you use when running has the contents of all those reference.conf files concatenated into a single file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM