我使用IntelliJ IDEA创建了一个新的Play Framework 2应用程序。我在默认项目中更改的唯一内容是创建Java控制器Application
而不是默认的Scala控制器(称为相同)并将Akka添加到项目中。
以下是我的 build.sbt 构建内容:
import play.Project._
name := "ServerSide"
version := "1.0"
// the following line was added
libraryDependencies += "com.typesafe.akka" % "akka-actor_2.10" % "2.3.3"
playScalaSettings
该项目编译得很好,但是当我启动它时,它会出现明显的Akka特定错误(事实上它在日志中重复了大约5次):
[ERROR] [07/23/2014 15:27:57.462] [play-akka.actor.default-dispatcher-2] [ActorSystem(play)] Uncaught error from thread [play-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.AbstractMethodError
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke(ActorCell.scala:487)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
at akka.dispatch.Mailbox.run(Mailbox.scala:220)
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
删除Akka可以解决问题。
错误的原因是什么?如何解决?
答案 0 :(得分:1)
我想出的答案是:
我从build.sbt
创建的项目中复制了activator
,但是Intellij Idea创建的项目很可能使用了早期版本的框架,因此它与Akka不兼容。将Akka版本更改为2.2.4解决了我的问题。