no configuration setting found for key akka

The problem is when using sbt:assembly the default merge strategy excludes all the reference.conf files as per

If multiple files share the same relative path (e.g. a resource named application.conf in multiple dependency JARs), the default strategy is to verify that all candidates have the same contents and error out otherwise.

The solution is to add a MergeStrategy as follows

assemblyMergeStrategy in assembly := {
  case PathList("reference.conf") => MergeStrategy.concat
}

Akka will read the configuration file from the following location by default:

  1. application.conf under root of classpath (including in jar)
  2. manually passed in configuration from ActorSystem("name", config).
  3. reference.conf under root of classpath (including in jar)

Please double check your classpath and see if you have a bad classpath reference which indicate a bad root of classpath for akka jars, spray jars, etc.


maven-shade-plugin configuration for maven users:

<configuration>
    <transformers>
        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
            <resource>reference.conf</resource>
        </transformer>
    </transformers>
</configuration>

Tags:

Scala

Akka

Spray