12 maj 2014 kl. 22:55 skrev Liang Tang <[email protected]>: > At the beginning, SBT worked very well I believe. > > However, in my project, I need to create a JAVA process by processBuilder. > Then, I have to use java -cp to launch akka program. > > The whole processBuilder command is: > /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java -cp > userpath/job123/:./javaLib/typesafe-config.jar:./javaLib/akka-actors.jar:./javaLib/akka-remote_2.10-2.3.2.jar:./lib/scala-library-2.10.3.jar > javaMapReduce.MapperWorker > > ActorSystem system = ActorSystem.create("worker"+name, > ConfigFactory.load("taskupdate")) gived me an exception: > > Exception in thread "main" java.lang.NoSuchMethodException: > akka.remote.RemoteActorRefProvider.<init>(java.lang.String, > akka.actor.ActorSystem$Settings, akka.event.EventStream, > akka.actor.Scheduler, akka.actor.DynamicAccess) > at java.lang.Class.getConstructor0(Class.java:2800) > at java.lang.Class.getDeclaredConstructor(Class.java:2043) > at > akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$2.apply(DynamicAccess.scala:77) > at scala.util.Try$.apply(Try.scala:161) > at > akka.actor.ReflectiveDynamicAccess.createInstanceFor(DynamicAccess.scala:74) > at > akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$3.apply(DynamicAccess.scala:85) > at > akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$3.apply(DynamicAccess.scala:85) > at scala.util.Success.flatMap(Try.scala:200) > at > akka.actor.ReflectiveDynamicAccess.createInstanceFor(DynamicAccess.scala:85) > at akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:546) > at akka.actor.ActorSystem$.apply(ActorSystem.scala:111) > at akka.actor.ActorSystem$.apply(ActorSystem.scala:104) > at akka.actor.ActorSystem$.create(ActorSystem.scala:66) > at akka.actor.ActorSystem.create(ActorSystem.scala) > at javaMapReduce.TaskUpdater.<init>(TaskUpdater.java:36) > at javaMapReduce.MapperWorker.run(MapperWorker.java:114) > at javaMapReduce.MapperWorker.main(MapperWorker.java:226) > > I searched online, and someone said it is because that scala library contains > old version of akka. Does it make this happen?
Yes, Scala 2.10 comes with Akka 2.1.0, which is not binary compatible with Akka 2.3.2. I recommend using sbt to resolve the dependencies instead of manually constructing a command line, i.e. using the runMain task. Regards, Roland > > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. Dr. Roland Kuhn Akka Tech Lead Typesafe – Reactive apps on the JVM. twitter: @rolandkuhn -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
