在将Akka添加到我的库依赖项并执行test
任务后,我知道为什么会出现以下错误?
Uncaught error from thread [reactivemongo-akka.actor.default-dispatcher-4] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[reactivemongo]
akka.actor.ActorCell.create(ActorCell.scala:580)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:263)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Exception in thread "Thread-4" java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2596)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at sbt.React.react(ForkTests.scala:116)
at sbt.ForkTests$$anonfun$mainTestTask$1$Acceptor$2$.run(ForkTests.scala:75)
at java.lang.Thread.run(Thread.java:724)
当我执行run
任务时:
Uncaught error from thread [reactivemongo-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[reactivemongo]
java.lang.AbstractMethodError
at akka.actor.ActorCell.create(ActorCell.scala:580)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:263)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[ERROR] [03/25/2014 15:28:17.309] [reactivemongo-akka.actor.default-dispatcher-2] [ActorSystem(reactivemongo)] Uncaught error from thread [reactivemongo-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.AbstractMethodError
at akka.actor.ActorCell.create(ActorCell.scala:580)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:263)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
我的相关build.sbt
设置
scalaVersion := "2.10.3"
// Dependencies
resolvers ++= Seq(
"Sonatype Releases" at "http://oss.sonatype.org/content/repositories/releases",
"Krasser's Bintray" at "http://dl.bintray.com/krasserm/maven"
)
libraryDependencies ++= Seq(
// akka
"com.typesafe.akka" %% "akka-actor" % "2.3.0",
"com.typesafe.akka" %% "akka-persistence-experimental" % "2.3.0",
"com.github.krasserm" % "akka-persistence-cassandra_2.10" % "0.2",
// dependency injection
"com.google.inject" % "guice" % "3.0",
"net.codingwell" % "scala-guice_2.10" % "4.0.0-beta",
"javax.inject" % "javax.inject" % "1",
// mongo
"org.reactivemongo" %% "reactivemongo" % "0.10.0",
"org.reactivemongo" %% "play2-reactivemongo" % "0.10.2",
// slick
"com.h2database" % "h2" % "1.3.166",
"com.typesafe" % "config" % "1.0.0",
"com.typesafe.slick" %% "slick" % "1.0.1",
// testing
"org.mockito" % "mockito-core" % "1.9.5" % "test",
"org.specs2" %% "specs2" % "2.3.8" % "test",
"org.scalacheck" %% "scalacheck" % "1.11.3" % "test"
)
// App settings
play.Project.playScalaSettings
我的project/plugin.sbt
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1")
这是在我使用以下库添加akka-persistence插件后开始的:
"com.typesafe.akka" %% "akka-actor" % "2.3.0",
"com.typesafe.akka" %% "akka-persistence-experimental" % "2.3.0",
"com.github.krasserm" % "akka-persistence-cassandra_2.10" % "0.2"
我安装了Cassandra,我在本地运行它。
即使我评论其中任何一行并运行sbt clean
,sbt update
和sbt test
,我仍然会看到此错误。只有当我对它们进行全面评论时,我才能运行并测试我的应用程序。
我唯一的猜测是持久性库和Play2中的Akka版本不兼容。
这听起来不错吗?
答案 0 :(得分:4)
Play 2.2.x使用Akka 2.2.x.您需要等待Play 2.3,它将与Akka 2.3兼容。