Hello,
I'm writing a distributed application and want to store remote path of
Actors in a central database, so that other network nodes can send messages
to the Actors.
I found a way to get the "default" full path as used in the clustering
support for Akka:
http://doc.akka.io/docs/akka/2.3.14/scala/serialization.html
1. object ExternalAddress extends ExtensionKey[ExternalAddressExt]
2.
3. class ExternalAddressExt(system: ExtendedActorSystem) extends
Extension {
4. def addressForAkka: Address = system.provider.getDefaultAddress
5. }
6.
7. def serializeAkkaDefault(ref: ActorRef): String =
8. ref.path.toSerializationFormatWithAddress(ExternalAddress(
theActorSystem).
9. addressForAkka)
However after I added this code into my project and tried to call the
serializeAkkaDefault function results in the following stack trace:
[ERROR] [09/26/2015 22:25:28.022] [FSM-akka.actor.default-dispatcher-3]
[akka://FSM/user/c2s-127.0.0.1:45607:38689]
main.scala.ClientFSM$ExternalAddressImpl.<init>(akka.actor.ExtendedActorSystem)
java.lang.NoSuchMethodException:
main.scala.ClientFSM$ExternalAddressImpl.<init>(akka.actor.ExtendedActorSystem)
at java.lang.Class.getConstructor0(Class.java:2902)
at java.lang.Class.getDeclaredConstructor(Class.java:2066)
at
akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$2.apply(DynamicAccess.scala:76)
at scala.util.Try$.apply(Try.scala:192)
at
akka.actor.ReflectiveDynamicAccess.createInstanceFor(DynamicAccess.scala:73)
at akka.actor.ExtensionKey.createExtension(Extension.scala:153)
at
akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:713)
at akka.actor.ExtensionId$class.apply(Extension.scala:79)
at akka.actor.ExtensionKey.apply(Extension.scala:149)
at main.scala.ClientFSM.getActorAddress(ClientFSM.scala:48)
at main.scala.ClientFSM$$anonfun$6.applyOrElse(ClientFSM.scala:166)
at main.scala.ClientFSM$$anonfun$6.applyOrElse(ClientFSM.scala:159)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:167)
at akka.actor.FSM$class.processEvent(FSM.scala:607)
at main.scala.ClientFSM.processEvent(ClientFSM.scala:35)
at akka.actor.FSM$class.akka$actor$FSM$$processMsg(FSM.scala:598)
at akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:592)
at akka.actor.Actor$class.aroundReceive(Actor.scala:467)
at main.scala.ClientFSM.aroundReceive(ClientFSM.scala:35)
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:397)
Googing shows this error could show up if I have an old version of Akka on
my classpath. I'm not sure if this is my case, however.
I'm running project via SBT and adding 'version = "2.3.14"' to
application.conf doesn't generate akka.ConfigurationException, which
indicates that version being used is actually 2.3.14
I've already spent few hours searching for a solution to no avail. Could
someone please point me in the right direction?
Thanks!
--
>>>>>>>>>> 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.