Akka Persistence Cassandra with Akka 2.3.0 throwing fatal EOFException when used with Play 2.2.1
Asked Answered
A

1

4

Any idea why I am getting the following error after adding Akka to my library dependencies and executing the test task?

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)

And when I execute the run task:

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)

My relevant build.sbt settings

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

And my project/plugin.sbt

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1")

This started after I added the akka-persistence plugin with the following libs:

"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"

I installed Cassandra and I am running it locally while doing this.

Even if I comment any one of these lines out and run sbt clean, sbt update, and sbt test I still see this error. Only when I comment them all out am I able to run and test my app.

My only guess is that the version of Akka in the persistence library and Play2 are incompatible.

Does that sound right?

Aragonite answered 25/3, 2014 at 20:32 Comment(1)
A similar question is here: #22780382Luther
C
4

Play 2.2.x uses Akka 2.2.x. You'll need to wait for Play 2.3 which will be compatible with Akka 2.3.

Chinch answered 26/3, 2014 at 4:5 Comment(2)
I'm pretty sure this is the issue. I tried to build Play from source to run the 2.3-SNAPSHOT, but I ran into an issue where the WS library was no longer accessible. I just reverted because I don't really have enough time to investigate. I'm just gonna see if I can use an older version of akka-persistence.Aragonite
You'll have to step back to the old eventsourced library for Akka which is the predecessor of akka-persistence. If you want to use the snapshot, know that WS was moved out of Play Core so you just need to add the dependency.Chinch

© 2022 - 2024 — McMap. All rights reserved.