No configuration setting found for key 'akka.version'
Solution 1:
It seems that your problem is bundling into a jar-with-dependencies
, which causes problems with Akka, as described in the documentation:
Warning
Akka's configuration approach relies heavily on the notion of every module/jar having its own reference.conf file, all of these will be discovered by the configuration and loaded. Unfortunately this also means that if you put/merge multiple jars into the same jar, you need to merge all the reference.confs as well. Otherwise all defaults will be lost and Akka will not function.
As suggested on the same page, you can use maven-shade-plugin
to merge all the reference configurations:
If you are using Maven to package your application, you can also make use of the Apache Maven Shade Plugin support for Resource Transformers to merge all the reference.confs on the build classpath into one.
See also: Akka: missing akka.version
Solution 2:
Had a similar issue:
com.typesafe.config.ConfigException$Missing:
No configuration setting found for key 'akka.persistence.journal-plugin-fallback'
Solved it with adding an appending transformer:
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>reference.conf</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
Solution 3:
So the problem generates while making a fat jar but not handling reference.conf the right way.
The explanation follows from @Zoltan's answer:
It seems that your problem is bundling into a jar-with-dependencies, which causes problems with Akka, as described in the documentation:
Warning
Akka's configuration approach relies heavily on the notion of every module/jar having its own reference.conf file, all of these will be discovered by the configuration and loaded. Unfortunately this also means that if you put/merge multiple jars into the same jar, you need to merge all the reference.confs as well. Otherwise all defaults will be lost and Akka will not function.
I have a solution for SBT users which doesn't require a plugin.
In build.sbt, add case "reference.conf" => MergeStrategy.concat
to your module assembly configuration.
lazy val module_name = (project in file("module_path"))
.settings(
name := "module_name",
commonSettings,
assemblyJarName in assembly := "module_name.jar",
test in assembly := {},
assemblyMergeStrategy in assembly := {
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
#################### The line which needs to be added ###################
case "reference.conf" => MergeStrategy.concat
case _ => MergeStrategy.first
}
)
.dependsOn(other_modules, other_modules2)
The command MergeStrategy.concat
literally functions the same way. While assembling whenever it encounters reference.conf it concatenates it to instead of creating a separate file for each akka module (which is the default behaviour).
Someone experienced on working with maven(pom.xml), please! extend this answer.
Solution 4:
Adding AppendingTransformer alone didn't resolve the issue for me. If you are trying to deploy your spark application on EMR and are still facing this issue then please take a look at my solution here. Hope it helps!
Solution 5:
Add the following plug-ins:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>allinone</shadedClassifierName>
<artifactSet>
<includes>
<include>*:*</include>
</includes>
</artifactSet>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>reference.conf</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>akka.Main</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
Reference here:akka—docs enter link description here