I am learning akka-remoting and this is how my project looks
The project structure looks like
project/pom.xml project/mymodule/pom.xml project/mymodule/src/main/resources/application.conf project/mymodule/src/main/scala/com.harit.akkaio.remote.RemoteApp.scala project/mymodule/src/main/scala/com.harit.akkaio.remote.ProcessingActor.scala
When I run my project on command-line
, I see
$ java -jar akkaio-remote/target/akka-remote-jar-with-dependencies.jar com.harit.akkaio.remote.RemoteApp Hello:com.harit.akkaio.remote.RemoteApp Exception in thread "main" com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka.version' at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:124) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:145) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:151) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:159) at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:164) at com.typesafe.config.impl.SimpleConfig.getString(SimpleConfig.java:206) at akka.actor.ActorSystem$Settings.(ActorSystem.scala:169) at akka.actor.ActorSystemImpl.(ActorSystem.scala:505) at akka.actor.ActorSystem$.apply(ActorSystem.scala:142) at akka.actor.ActorSystem$.apply(ActorSystem.scala:119) at com.harit.akkaio.remote.RemoteApp$.startProcessingActorSystem(RemoteApp.scala:16) at com.harit.akkaio.remote.RemoteApp$.main(RemoteApp.scala:12) at com.harit.akkaio.remote.RemoteApp.main(RemoteApp.scala)
RemoteApp.scala
package com.harit.akkaio.remote import akka.actor.{ActorRef, ActorSystem, Props} import com.typesafe.config.ConfigFactory import scala.concurrent.duration._ object RemoteApp { def main(args: Array[String]): Unit = { println("Hello:" + args.head) startProcessingActorSystem() } def startProcessingActorSystem() = { val system = ActorSystem("ProcessingSystem", ConfigFactory.load()) println("ProcessingActorSystem Started") } }
ProcessingActor.scala
package com.harit.akkaio.remote import akka.actor.{Actor, ActorLogging} case object Process case object Crash class ProcessingActor extends Actor with ActorLogging { def receive = { case Process => log.info("processing big things") case Crash => log.info("crashing the system") context.stop(self) } }
application.conf
akka { remote.netty.tcp.port = 2552 }
mymodule.pom.xml
akkaio com.harit 1.0-SNAPSHOT 4.0.0 akkaio-remote 2.3.11 com.typesafe.akka akka-remote_2.11 ${akka-remote_2.11.version} maven-assembly-plugin akka-remote com.harit.akkaio.remote.RemoteApp jar-with-dependencies make-assembly package single
pom.xml
4.0.0 com.harit akkaio 1.0-SNAPSHOT akkaio-remote pom 2015 2.11.6 4.12 2.2.5 2.3.11 2.3.11 2.3.11 1.10.19 2.11.6 1.0 scala-tools.org Scala-Tools Maven2 Repository http://scala-tools.org/repo-releases scala-tools.org Scala-Tools Maven2 Repository http://scala-tools.org/repo-releases org.scala-lang scala-library ${scala.version} com.typesafe.akka akka-actor_2.11 ${akka-actor_2.11.version} com.typesafe.akka akka-slf4j_2.11 ${akka-slf4j_2.11.version} org.scalatest scalatest-maven-plugin ${scalatest-maven-plugin.version} compile com.typesafe.akka akka-testkit_2.11 ${akka-testkit_2.11.version} test org.scalatest scalatest_2.11 ${scalatest_2.11.version} test clean install org.scala-tools maven-scala-plugin compile testCompile ${maven-scala-plugin.scalaCompatVersion} ${scala.version} ${scala.version} -target:jvm-1.8 org.apache.maven.plugins maven-surefire-plugin 2.7 true org.scalatest scalatest-maven-plugin 1.0 ${project.build.directory}/surefire-reports . WDF TestSuite.txt test test org.scala-tools maven-scala-plugin ${scala.version}
What am I missing out? Thanks