Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating an Akka fat Jar
    text
    copied!<p>I need to create a Nutch plugin that communicate with some external applications using Akka. In order to do this, I need to package the plugin as a fat Jar - I am using <a href="https://github.com/sbt/sbt-assembly/" rel="nofollow">sbt-assembly</a> version 0.8.3.</p> <p>When I try to run the plugin, I get the exception </p> <pre><code>com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka' </code></pre> <p>as if Akka was not able to find <code>reference.conf</code>. This is weird, because <code>sbt-assembly</code> <a href="http://letitcrash.com/post/21706121997/follow-up-sbt-assembly-now-likes-reference-conf" rel="nofollow">should be able</a> to package that file correctly, and in fact I can see its content in the created jar.</p> <p>My <code>build.sbt</code> looks like this:</p> <pre><code>import AssemblyKeys._ name := "my-project" version := "0.1-SNAPSHOT" scalaVersion := "2.10.0" resolvers ++= Seq( "Central Repo" at "http://repo1.maven.org/maven2", "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/", "Akka io" at "http://akka.io/repository" ) libraryDependencies ++= Seq( ..., "com.typesafe.akka" %% "akka-actor" % "2.1.1", "com.typesafe.akka" %% "akka-remote" % "2.1.1" ) seq(assemblySettings: _*) mergeStrategy in assembly &lt;&lt;= (mergeStrategy in assembly) { (old) =&gt; { case "plugin.xml" =&gt; MergeStrategy.first case x if x startsWith "org/apache/jasper" =&gt; MergeStrategy.last case x if x startsWith "javax/xml" =&gt; MergeStrategy.last case x if x startsWith "javax/servlet" =&gt; MergeStrategy.last case x if x startsWith "org/apache/commons" =&gt; MergeStrategy.last case x if x startsWith "org/apache/xmlcommons" =&gt; MergeStrategy.last case x if x startsWith "org/xml/sax" =&gt; MergeStrategy.last case x if x startsWith "org/w3c/dom" =&gt; MergeStrategy.last case x =&gt; old(x) } } </code></pre> <p>The last lines are needed to fix some conflicts between nutch and hadoop.</p> <blockquote> <p>What is the correct way to package an Akka application?</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload