persistentActor not receiving messages??

312 views
Skip to first unread message

Ian Holsman

unread,
Nov 5, 2015, 6:07:27 PM11/5/15
to Akka User
Hi.

I'm having a bit of trouble at the moment, and I think it's due to me upgrading to most recent versions of things.

I was on 2.3.11 of akka & akka-persistence-experimental , and using 1.0-RC3 of akka-http.

I'm now on 2.4.0 / 1.0 respectively.

I had to change the code (minor) due to syntax changes but I don't feel it is that.
I also had to add a leveldb configuration area in application.conf which i'm guessing is the issue.

fwiw the actor works as a 'regular' actor in terms of actually receiving the message .. this is my actor code.. (it should just print out something but it doesn't).

class VillageManager(nameGenerator:String) extends PersistentActor  with ActorLogging {
override def persistenceId: String = s"village-manager"
override def receiveRecover: Receive = {
case _ => log.error("VillageMgr - unknown")
}
override def receiveCommand: Receive = {
case _ =>
println("in Actor")
log.error("Undefined message")
}
}

object VillageManager {
def props(nameGen: String): Props = Props(classOf[VillageManager], nameGen)
}

my application.conf is
akka {
log-dead-letters = 10
log-dead-letters-during-shutdown = on

persistence {
snapshot-store {
plugin = "leveldb"
local.dir = "target/persistence/snapshots"
}

journal {
plugin = "leveldb"
leveldb {
dir = "target/persistence/journal"
native = true
}
}
}
}

leveldb {
dir = "target/persistence/journal"
checksum: "off"
class: "akka.persistence.journal.leveldb.LeveldbJournal"
dir: "target/persistence/journal"
fsync: "on"
native: "on"
plugin-dispatcher : "akka.persistence.dispatchers.default-plugin-dispatcher"
replay-dispatcher : "akka.persistence.dispatchers.default-replay-dispatcher"
}
my build.sbt is:
import sbt.Keys._

name := "projectName"

version := "1.0"

scalaVersion := "2.11.7"

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

resolvers += "bintray/meetup" at "http://dl.bintray.com/meetup/maven"

val akkaVersion = "2.4.0"
val akkaStream = "1.0"

scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test",
"com.typesafe.akka" %% "akka-persistence" % akkaVersion,
"com.typesafe.akka" % "akka-http-core-experimental_2.11" % akkaStream,
"com.typesafe.akka" % "akka-http-experimental_2.11" % akkaStream,
"com.typesafe.akka" % "akka-stream-experimental_2.11" % akkaStream,
"io.jvm.uuid" %% "scala-uuid" % "0.2.1",
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.6.1",
"org.scalatest" %% "scalatest" % "2.2.5",
"junit" % "junit" % "4.12" % "test",
"org.iq80.leveldb" % "leveldb" % "0.7",
"org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8",
"com.meetup" %% "archery" % "0.4.0"
)


lazy val root = (project in file(".")).enablePlugins(SbtTwirl)

I'm at a loss on how to debug this.

--
Ian Holsman
PH: + 61-3-9028 8133 / +1-(425) 998-7083

matheus...@gmail.com

unread,
Nov 5, 2015, 7:17:07 PM11/5/15
to Akka User List
I guess the problem is how you are setting the persistence plugin:
Try change it:
  • akka.persistence.journal.plugin = "leveldb" ->
  • akka.persistence.journal.plugin = "akka.persistence.journal.leveldb"

  • akka.persistence.snapshot-store.plugin = "leveldb" ->
  • akka.persistence.snapshot-store.plugin = "akka.persistence.snapshot-store.local"

I don't know if leveldb has a snapshot plugin...
By the way, in my experience, issues with send message to persistent actor normally are associated with persistence plugin settings. The actor cannot be initialized if there is problems with persistence.

Ian Holsman

unread,
Nov 5, 2015, 7:28:22 PM11/5/15
to Akka User
Thanks Matheus.
That resolved the issue.

Regards
Ian

--
>>>>>>>>>> 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 akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Patrik Nordwall

unread,
Nov 6, 2015, 12:58:43 AM11/6/15
to Akka User
Didn't you see anything in the logs? I'm asking because if it is silent it is something we must improve.

/Patrik

mathe...@sagaranatech.com

unread,
Nov 6, 2015, 6:15:00 AM11/6/15
to Akka User List
I've had a similar problem during creation of some multi node tests using leveldb as storage. The leveldb was misconfigured and my persistent actors crashed silently...

Ian Holsman

unread,
Nov 6, 2015, 10:16:34 AM11/6/15
to Akka User
completely silent.

Patrik Nordwall

unread,
Nov 6, 2015, 10:51:31 AM11/6/15
to akka...@googlegroups.com

Strange, I see this:

[ERROR] [11/06/2015 16:49:48.776] [PersistenceSpec-akka.actor.default-dispatcher-3] [akka://PersistenceSpec/user/$a] null
akka.actor.ActorInitializationException: exception during creation
    at akka.actor.ActorInitializationException$.apply(Actor.scala:172)
    at akka.actor.ActorCell.create(ActorCell.scala:605)
    at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:460)
    at akka.actor.ActorCell.systemInvoke(ActorCell.scala:482)
    at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
    at akka.dispatch.Mailbox.run(Mailbox.scala:223)
    at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
    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)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at akka.util.Reflect$.instantiate(Reflect.scala:65)
    at akka.actor.ArgsReflectConstructor.produce(Props.scala:348)
    at akka.actor.Props.newActor(Props.scala:259)
    at akka.actor.ActorCell.newActor(ActorCell.scala:561)
    at akka.actor.ActorCell.create(ActorCell.scala:587)
    ... 9 more
Caused by: java.lang.IllegalArgumentException: requirement failed: 'reference.conf' is missing persistence plugin config path: 'akka.persistence.wrong-journal.leveldb'
    at scala.Predef$.require(Predef.scala:219)
    at akka.persistence.Persistence$PluginHolderExtensionId.createExtension(Persistence.scala:284)
    at akka.persistence.Persistence$PluginHolderExtensionId.createExtension(Persistence.scala:282)
    at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:752)
    at akka.actor.ExtensionId$class.apply(Extension.scala:79)
    at akka.persistence.Persistence$PluginHolderExtensionId.apply(Persistence.scala:282)
    at akka.persistence.Persistence.pluginHolderFor(Persistence.scala:246)
    at akka.persistence.Persistence.journalConfigFor(Persistence.scala:202)
    at akka.persistence.Eventsourced$class.$init$(Eventsourced.scala:54)
    at akka.persistence.NamedPersistentActor.<init>(PersistenceSpec.scala:84)
    at akka.persistence.PersistentActorSpec$ExamplePersistentActor.<init>(PersistentActorSpec.scala:25)
    at akka.persistence.PersistentActorSpec$Behavior1PersistentActor.<init>(PersistentActorSpec.scala:45)
    ... 18 more

Patrik Nordwall
Typesafe Reactive apps on the JVM
Twitter: @patriknw

Reply all
Reply to author
Forward
0 new messages