Problems using a Remote Actor

599 views
Skip to first unread message

Sandro Martini

unread,
Mar 5, 2015, 12:52:55 PM3/5/15
to akka...@googlegroups.com
Hi all,
I'm doing some tests with Akka Remote Actors, but I'm in trouble with some strange problem, but I think it's something that I'm doing in the wrong way ...

I'm using Akka-2.2.4 (tomorrow I'll update to 2.2.5) with an updated JDK 7 on Windows 7.
My sources are here: https://github.com/smartiniOnGitHub/akka-tests
the project is a Gradle (2.3) multi-project, because I'm trying to make it work with Java and then to port all in Groovy (and then in Scala), so please now let's focus on the Java version.

The make some test, you can run the following commands (under Windows):

rem cls && gradle tasks
cls && gradle clean build --refresh-dependencies
cls && gradle runJavaAkkaRemoteServer
or
cls && start gradle runJavaAkkaRemoteServer
cls && gradle runJavaAkkaRemoteClient

Anyway the "server" source is here:
https://github.com/smartiniOnGitHub/akka-tests/blob/master/akka-tests-java/src/main/java/akka_tests/java/server/AkkaRemoteServer.java

When I run the "server", I get this:

:akka-tests-java:runJavaAkkaRemoteServer
Application: main, start a simple server console application for creating some Akka Actors and make them reachable from other (remote) processes

setup: start at Wed Mar 04 19:04:33 CET 2015.
Akka Config: akka {
    loglevel = "INFO"
    actor {
        provider = "akka.remote.RemoteActorRefProvider"
    }
    remote {
        enabled-transports = ["akka.remote.netty.tcp"]
        netty.tcp {
            hostname = "127.0.0.1"
            # Server, listen on default Akka tcp port (2552)
            port = 2552
        }
        log-sent-messages = on
        log-received-messages = on
        log-remote-lifecycle-events = on
        log-frame-size-exceeding = on
        # log-buffer-size-exceeding = 50000
    }
}
using Java ClassLoader: sun.misc.Launcher$AppClassLoader@187aeca
using Akka version: 2.2.4
Actor System configuration: Config(SimpleConfigObject({"akka":{"loglevel":"INFO","remote":{"log-remote-lifecycle-events":"on","netty":{"tcp":{"port":2552,"hostname":"127.0.0.1"}},"enabled-transports":["akka.remote.netty.tcp"],"log-frame-size-exceeding":"on","log-sent-messages":"on","log-received-messages":"on"},"actor":{"provider":"akka.remote.RemoteActorRefProvider"}}}))
[INFO] [03/04/2015 19:04:34.241] [main] [Remoting] Starting remoting
[INFO] [03/04/2015 19:04:34.408] [main] [Remoting] Remoting started; listening on addresses :[akka.tcp://RemoteAc...@127.0.0.1:2552]
[INFO] [03/04/2015 19:04:34.410] [main] [Remoting] Remoting now listens on addresses: [akka.tcp://RemoteAc...@127.0.0.1:2552]
Actor System instance: akka://RemoteActorSystem
props: Props(Deploy(,Config(SimpleConfigObject({})),NoRouter,NoScopeGiven,,),class akka_tests.java.actor.GreetingActor,List())
setup: end at Wed Mar 04 19:04:34 CET 2015.
Get Actor Reference to greetingActor: Actor[akka://RemoteActorSystem/user/greetingActor#-1752332594]
setup: end at Wed Mar 04 19:04:35 CET 2015.
check: start at Wed Mar 04 19:04:35 CET 2015.
Actor Reference instance is: Actor[akka://RemoteActorSystem/user/$a#-314651576]
[INFO] [03/04/2015 19:04:35.429] [RemoteActorSystem-akka.actor.default-dispatcher-6] [akka://RemoteActorSystem/user/$a] akka_tests.java.message.Greeting: Hello "Test Greeting"
[INFO] [03/04/2015 19:04:35.434] [RemoteActorSystem-akka.actor.default-dispatcher-2] [akka://RemoteActorSystem/deadLetters] Message [java.lang.String] from Actor[akka://RemoteActorSystem/user/$a#-314651576] to Actor[akka://RemoteActorSystem/deadLetters] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [03/04/2015 19:04:35.439] [RemoteActorSystem-akka.actor.default-dispatcher-6] [akka://RemoteActorSystem/user/$a] java.lang.String: "Test String"
[WARN] [03/04/2015 19:04:35.439] [RemoteActorSystem-akka.actor.default-dispatcher-6] [akka://RemoteActorSystem/user/$a] Unknown message type akka_tests.java.message.GenericMessage, contents: "akka_tests.java.message.GenericMessage@1837e72"
[INFO] [03/04/2015 19:04:35.442] [RemoteActorSystem-akka.actor.default-dispatcher-5] [akka://RemoteActorSystem/deadLetters] Message [java.lang.String] from Actor[akka://RemoteActorSystem/user/$a#-314651576] to Actor[akka://RemoteActorSystem/deadLetters] was not delivered. [2] dead letters encountered. This logging canbe turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
check: end at Wed Mar 04 19:04:35 CET 2015.
check (remote): start at Wed Mar 04 19:04:35 CET 2015.
Akka Config: akka {
    loglevel = "INFO"
    actor.provider = "akka.remote.RemoteActorRefProvider"
    remote.enabled-transports = ["akka.remote.netty.tcp"]
    remote.netty.tcp.hostname="127.0.0.1"
    remote.netty.tcp.port = 0
}
[INFO] [03/04/2015 19:04:35.980] [main] [Remoting] Starting remoting
[INFO] [03/04/2015 19:04:36.005] [main] [Remoting] Remoting started; listening on addresses :[akka.tcp://RemoteActorS...@127.0.0.1:63830]
[INFO] [03/04/2015 19:04:36.005] [main] [Remoting] Remoting now listens on addresses: [akka.tcp://RemoteActorS...@127.0.0.1:63830]
systemClient: akka://RemoteActorSystem-Client
Actor System instance: akka://RemoteActorSystem-Client
remote actor system base path: akka.tcp://RemoteAc...@127.0.0.1:2552/user/

Get Actor Selection to greetingActor: ActorSelection[Actor[akka.tcp://RemoteAc...@127.0.0.1:2552/]/user/greetingActor]
[ERROR] [03/04/2015 19:04:36.647] [RemoteActorSystem-akka.actor.default-dispatcher-2] [akka://RemoteActorSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteActorSystem-Client%40127.0.0.1%3A63830-0/endpointWriter] changing Recreate into Create after akka.actor.ActorInitializationException: exception during creation
[ERROR] [03/04/2015 19:04:36.649] [RemoteActorSystem-akka.actor.default-dispatcher-2] [akka://RemoteActorSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteActorSystem-Client%40127.0.0.1%3A63830-0/endpointWriter] changing Recreate into Create after akka.actor.ActorInitializationException: exception during creation
[ERROR] [03/04/2015 19:04:36.654] [RemoteActorSystem-akka.actor.default-dispatcher-5] [akka://RemoteActorSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteActorSystem-Client%40127.0.0.1%3A63830-0/endpointWriter] changing Recreate into Create after akka.actor.ActorInitializationException: exception during creation
[INFO] [03/04/2015 19:04:37.038] [RemoteActorSystem-Client-akka.actor.default-dispatcher-4] [akka://RemoteActorSystem-Client/system/remoting-terminator] Shutting down remote daemon.
[INFO] [03/04/2015 19:04:37.045] [RemoteActorSystem-Client-akka.actor.default-dispatcher-4] [akka://RemoteActorSystem-Client/system/remoting-terminator] Remote daemon shut down; proceeding with flushing remote transports.
[INFO] [03/04/2015 19:04:37.081] [RemoteActorSystem-akka.actor.default-dispatcher-5] [akka://RemoteActorSystem/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2FRemoteActorSystem%40127.0.0.1%3A63831-1] Message [akka.remote.transport.AssociationHandle$Disassociated] from Actor[akka://RemoteActorSystem/deadLetters] to Actor[akka://RemoteActorSystem/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2FRemoteActorSystem%40127.0.0.1%3A63831-1#-1101030645] was not delivered. [3] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [03/04/2015 19:04:37.083] [RemoteActorSystem-Client-akka.actor.default-dispatcher-2] [akka://RemoteActorSystem-Client/system/transports/akkaprotocolmanager.tcp1/akkaProtocol-tcp%3A%2F%2FRemoteActorSystem%40127.0.0.1%3A2552-1] Message [akka.remote.transport.AssociationHandle$Disassociated] from Actor[akka://RemoteActorSystem-Client/deadLetters] to Actor[akka://RemoteActorSystem-Client/system/transports/akkaprotocolmanager.tcp1/akkaProtocol-tcp%3A%2F%2FRemoteActorSystem%40127.0.0.1%3A2552-1#-2051041524] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [03/04/2015 19:04:37.086] [RemoteActorSystem-Client-akka.actor.default-dispatcher-2] [akka://RemoteActorSystem-Client/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteActorSystem%40127.0.0.1%3A2552-0/endpointWriter/endpointReader-akka.tcp%3A%2F%2FRemoteActorSystem%40127.0.0.1%3A2552-0] Message [akka.dispatch.sysmsg.Terminate] from Actor[akka://RemoteActorSystem-Client/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteActorSystem%40127.0.0.1%3A2552-0/endpointWriter/endpointReader-akka.tcp%3A%2F%2FRemoteActorSystem%40127.0.0.1%3A2552-0#-1785566651] to Actor[akka://RemoteActorSystem-Client/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteActorSystem%40127.0.0.1%3A2552-0/endpointWriter/endpointReader-akka.tcp%3A%2F%2FRemoteActorSystem%40127.0.0.1%3A2552-0#-1785566651] was not delivered. [2] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [03/04/2015 19:04:37.120] [ForkJoinPool-3-worker-7] [Remoting] Remoting shut down
[INFO] [03/04/2015 19:04:37.121] [RemoteActorSystem-Client-akka.actor.default-dispatcher-7] [akka://RemoteActorSystem-Client/system/remoting-terminator] Remoting shut down.
check (remote): end at Wed Mar 04 19:04:37 CET 2015.

Server ready ...

Application: main, end at Wed Mar 04 19:04:37 CET 2015.
> Building 87% > :akka-tests-java:runJavaAkkaRemoteServer

to stop the process then I have to do some <CTRL>C , ok.


Note that the method checkSystemRemote() is to try to use/consume the remote actor diretcly from there, but is it possible (even only for tests) ?
Using the "client" I get a similar error (even if client code is not aligned at 100%).


One time all will work I'll update even to latest Akka-2.3.x :-) ... then I plan to publish an updated Grails Plugin for Akka (using it, sources at GitHUB too), both for 2.2.x and after for 2.3.x . So it's not a problem even to change Akka version, my trouble is to better understand if/what I'm no doing well here ...
Note that most of the work here is mainly to be able to use it from Groovy, and to show its usage (and in a Gradle project) ... so really I need before to make it work :-) .


Thanks a lot for the help.

Regards,
Sandro


Sandro Martini

unread,
Mar 10, 2015, 5:32:29 AM3/10/15
to akka...@googlegroups.com
Hi, sorry but even after some small changes I'm still stuck with the problem, tried with Akka-2.2.4, 2.2.5, 2.3.9 .
From local actor system all works good.

I don't really understand the error when using remote actor with actorSelection:

[ERROR] [03/09/2015 18:33:44.918] [RemoteActorSystem-akka.actor.default-dispatcher-3] [akka://RemoteActorSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteActorSystem-Client%40127.0.0.1%3A57311-0/endpointWriter] changing Recreate into Create after akka.actor.ActorInitializationException: exception during creation

Instead, using the deprecated methos (actorFor) I don't have the error, but messages goes to deadLetters, so maybe even in this case there is something to fix ...
The source for the "server" is here:
https://github.com/smartiniOnGitHub/akka-tests/blob/master/akka-tests-java/src/main/java/akka_tests/java/server/AkkaRemoteServer.java

Someone can give me some hint ?

Thanks a lot,
Sandro
[INFO] [03/04/2015 19:04:34.408] [main] [Remoting] Remoting started; listening on addresses :[akka.tcp://RemoteActorSystem@127.0.0.1:2552]
[INFO] [03/04/2015 19:04:34.410] [main] [Remoting] Remoting now listens on addresses: [akka.tcp://RemoteActorSystem@127.0.0.1:2552]

Actor System instance: akka://RemoteActorSystem
props: Props(Deploy(,Config(SimpleConfigObject({})),NoRouter,NoScopeGiven,,),class akka_tests.java.actor.GreetingActor,List())
setup: end at Wed Mar 04 19:04:34 CET 2015.
Get Actor Reference to greetingActor: Actor[akka://RemoteActorSystem/user/greetingActor#-1752332594]
setup: end at Wed Mar 04 19:04:35 CET 2015.
check: start at Wed Mar 04 19:04:35 CET 2015.
Actor Reference instance is: Actor[akka://RemoteActorSystem/user/$a#-314651576]
[INFO] [03/04/2015 19:04:35.429] [RemoteActorSystem-akka.actor.default-dispatcher-6] [akka://RemoteActorSystem/user/$a] akka_tests.java.message.Greeting: Hello "Test Greeting"
[INFO] [03/04/2015 19:04:35.434] [RemoteActorSystem-akka.actor.default-dispatcher-2] [akka://RemoteActorSystem/deadLetters] Message [java.lang.String] from Actor[akka://RemoteActorSystem/user/$a#-314651576] to Actor[akka://RemoteActorSystem/deadLetters] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
[INFO] [03/04/2015 19:04:35.439] [RemoteActorSystem-akka.actor.default-dispatcher-6] [akka://RemoteActorSystem/user/$a] java.lang.String: "Test String"
[WARN] [03/04/2015 19:04:35.439] [RemoteActorSystem-akka.actor.default-dispatcher-6] [akka://RemoteActorSystem/user/$a] Unknown message type akka_tests.java.message.GenericMessage, contents: "akka_tests.java.message.GenericMessage@1837e72"
[INFO] [03/04/2015 19:04:35.442] [RemoteActorSystem-akka.actor.default-dispatcher-5] [akka://RemoteActorSystem/deadLetters] Message [java.lang.String] from Actor[akka://RemoteActorSystem/user/$a#-314651576] to Actor[akka://RemoteActorSystem/deadLetters] was not delivered. [2] dead letters encountered. This logging canbe turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
check: end at Wed Mar 04 19:04:35 CET 2015.
check (remote): start at Wed Mar 04 19:04:35 CET 2015.
Akka Config: akka {
    loglevel = "INFO"
    actor.provider = "akka.remote.RemoteActorRefProvider"
    remote.enabled-transports = ["akka.remote.netty.tcp"]
    remote.netty.tcp.hostname="127.0.0.1"
    remote.netty.tcp.port = 0
}
[INFO] [03/04/2015 19:04:35.980] [main] [Remoting] Starting remoting
[INFO] [03/04/2015 19:04:36.005] [main] [Remoting] Remoting started; listening on addresses :[akka.tcp://RemoteActorSystem-Cl...@127.0.0.1:63830]
[INFO] [03/04/2015 19:04:36.005] [main] [Remoting] Remoting now listens on addresses: [akka.tcp://RemoteActorSystem-Cli...@127.0.0.1:63830]

systemClient: akka://RemoteActorSystem-Client
Actor System instance: akka://RemoteActorSystem-Client
remote actor system base path: akka.tcp://RemoteActorSystem@127.0.0.1:2552/user/

Patrik Nordwall

unread,
Mar 10, 2015, 10:07:51 AM3/10/15
to akka...@googlegroups.com
Hi Sandro,

This looks bad:
[ERROR] [03/04/2015 19:04:36.647] [RemoteActorSystem-akka.actor.default-dispatcher-2] [akka://RemoteActorSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteActorSystem-Client%40127.0.0.1%3A63830-0/endpointWriter] changing Recreate into Create after akka.actor.ActorInitializationException: exception during creation

Try with serialize-creators = off and serialize-messages = off.

It might be an issue with these settings that has been fixed in 2.3.x.

/Patrik

--
>>>>>>>>>> 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
Typesafe Reactive apps on the JVM
Twitter: @patriknw

 Scala Days

Sandro Martini

unread,
Mar 10, 2015, 11:21:57 AM3/10/15
to akka...@googlegroups.com
Hi Patrik,
thanks for the info ... I tried your suggestion both with Akka-2.2.5 and 2.3.9 but I still have some error, this is the log from 2.3.9:

remote actor lookup using actor selection
Get Actor Selection to greetingActor: ActorSelection[Anchor(akka.tcp://RemoteAc...@127.0.0.1:2552/), Path(/user/greetingActor)]
[WARN] [03/10/2015 16:12:32.607] [RemoteActorSystem-akka.remote.default-remote-dispatcher-6] [akka.tcp://RemoteAc...@127.0.0.1:2552/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteActorSystem-Client%40127.0.0.1%3A55003-0] Association with remote system [akka.tcp://RemoteActorS...@127.0.0.1:55003] has failed, address is now gated for [5000] ms. Reason is: [exception during creation].remote actor

whatr does it mean ? my actor should be Serializable ?

lookup using actor for
[INFO] [03/10/2015 16:12:33.000] [RemoteActorSystem-akka.actor.default-dispatcher-15] [akka://RemoteActorSystem/user/greetingActor] java.lang.String: "Test Remote"
[INFO] [03/10/2015 16:12:33.001] [RemoteActorSystem-akka.actor.default-dispatcher-2] [akka://RemoteActorSystem/deadLetters] Message [java.lang.String] from Actor[akka://RemoteActorSystem/user/greetingActor#2062187471] to Actor[akka://RemoteActorSystem/deadLetters] was not delivered. [3] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.

as you can see using actorFor something seems to be a little better but still not working ...


I really don't understand what could be wrong in my code ... please help me to make it work :-) .
Should I open an issue ?


Thanks a lot,
Sandro

Jim Hazen

unread,
Mar 10, 2015, 3:54:20 PM3/10/15
to akka...@googlegroups.com
Have you followed all of the instructions for interacting with remote actors here: http://doc.akka.io/docs/akka/2.3.9/scala/remoting.html ?

From the error it appears to me that:
1. You are attempting to create a remote actor from a peer
2. This peer isn't able to properly interact with [akka.tcp://RemoteActorSystem-Cli...@127.0.0.1:55003]

Are you using a Remote or Clustered ActorRefProviders on both nodes?  Is your remote transport properly configured to run on those ports?  Is it starting properly? Is your networking configured to allow access to those ports (software firewalls on a node have burned me in the past).  Does the RemoteActorSystem-Client AS exist on that port, or is some other AS running there?  There's a lot to look at, but it ought to work once everything is wired properly.  Maybe look for a working example (from Activator) and then adapt the working thing to your needs?

Sandro Martini

unread,
Mar 12, 2015, 6:07:00 AM3/12/15
to akka...@googlegroups.com
Hi Jim, thanks for the help ...


Have you followed all of the instructions for interacting with remote actors here: http://doc.akka.io/docs/akka/2.3.9/scala/remoting.html ?
I follow this because I'm using the Java version of the API:
http://doc.akka.io/docs/akka/2.2.5/java/remoting.html
and them the updated (more/better info)
http://doc.akka.io/docs/akka/2.3.9/java/remoting.html

Note that I have the same behavior from 3 different pc (Windows and Linux) and with different patch levels on JDK 7 (but all recent), so it's something related to code ...

Just for info, my project is made with Gradle 2.3, so to try it its' enough to checkout with git, and run it with Gradle (if already installed, or its wrapper will download it), and all dependencies are downloaded at first run, I made it to make it simple for anyone to run/try it.
 

From the error it appears to me that:
1. You are attempting to create a remote actor from a peer
yes, but I didn't read for problems with it in documentation ...

2. This peer isn't able to properly interact with [akka.tcp://RemoteActorSystem-Cli...@127.0.0.1:55003]
yes but from the error/warning message it's not clear what is the real problem ...


Are you using a Remote or Clustered ActorRefProviders on both nodes?  
no, I'm using normal  akka.remote.RemoteActorRefProvider

Is your remote transport properly configured to run on those ports?  Is it starting properly? Is your networking configured to allow access to those ports (software firewalls on a node have burned me in the past).
yes, I see that the related port is open, with an OS diagnostic tool
 
Does the RemoteActorSystem-Client AS exist on that port, or is some other AS running there?
nothing special is running
 
There's a lot to look at, but it ought to work once everything is wired properly.
yes, but all seems ok, so really I think it's a problem in my code
 
Maybe look for a working example (from Activator) and then adapt the working thing to your needs?
maybe this is a good option, but my sample here is even to try to use Akka from a (little) different point of view (and tools like Gradle) ... maybe even Akka documentation could be improved, at least to better explain some pitfalls on exposing actors with remoting  ... just as a suggestion for Akka team.
One of goals for my test project is even to share/improve some knowledge on using Akka from other tools (mainly the Groovy/Gradle/Grails stack) with others :-) .


Thanks a lot for the help.
Sandro

Sandro Martini

unread,
Mar 12, 2015, 7:51:42 AM3/12/15
to akka...@googlegroups.com
A quick update,
a notable difference in my sources is that I call the actorSelection(...) but from my client actor system, and not from another actor (in the usual way contect.actorSelection(...) find in many documents):

ActorSelection selection = systemClient.actorSelection(remoteBasePath + remoteActorName);

could be this ?
If yes, are there some good reason to not do the call in this way ?

Should I open an issue in Akka (to fix it, or at least to clarify this in docs) ?

Sorry for all these questions, but I'm really trying to better understand (and simplify if possible) this ...


Thanks,
Sandro

Patrik Nordwall

unread,
Mar 23, 2015, 5:11:32 AM3/23/15
to akka...@googlegroups.com
I tried to run your code before my first reply here, but it was too complicated and I did not have the time to untangle it. I think it would be great if you can first try with the Activator sample Akka Remote Samples with Java and then add minimal things until it does not work as you expect.

system.actorSelection and context.actorSelection should both work.

Regards,
Patrik 

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

Sandro Martini

unread,
Mar 23, 2015, 5:48:13 AM3/23/15
to akka...@googlegroups.com
Hi Patrick,
thank you very much for the time you spend here ...

> I tried to run your code before my first reply here, but it was too complicated and I did not have the time to untangle it.
strange, I'm trying to create an Akka System and create an instance of
an Actor for remote usage.
I'd like to make it work in the following way (maybe it's a wrong way
with Akka):
a "server" publisher of actors available to remote consumers (like an
EJB server), and a "client" that does the lookup and consume remote
actors.
I know that the code is full of tests/commented code etc, I'll clean
up when all works as expected :-) ; because my priority here is to
migrate Java code in the Groovy version, and then use in as a sample
in my Grails-Akka Plugin (where I already have some minimal Groovy
Shell scripts as a sample, but not working with remote).

> I think it would be great if you can first try with the Activator sample Akka Remote Samples with Java and then add minimal things until it does not work as you expect.
ok, I'll try even this ... but from what I see in the code you never
lookup a remote actor directly from an Akka System, could it be this
my pitfall ? If it is, is there a good reason for this behavior ?
Sorry but I didn't find a clear answer/example to this question, even
after reading a lot of docs and blogs on Akka ...

> system.actorSelection and context.actorSelection should both work.
the strange thing here is that using the published actor directly from
system.actorSelection (using the Java API) I get exception during
actor creation (but only when calling it via remote), but really I
don't understand what could be.
Maybe only some more info on this (in Akka documentation, really
helpful) can help me and others.

Akka is really a great framework, but it needs rethinking of some
things, thanks for the patience :-) ...

Thanks for now,
Sandro

Patrik Nordwall

unread,
Mar 23, 2015, 12:30:34 PM3/23/15
to akka...@googlegroups.com
On Mon, Mar 23, 2015 at 10:48 AM, Sandro Martini <sandro....@gmail.com> wrote:
Hi Patrick,
thank you very much for the time you spend here ...

> I tried to run your code before my first reply here, but it was too complicated and I did not have the time to untangle it.
strange, I'm trying to create an Akka System and create an instance of
an Actor for remote usage.
I'd like to make it work in the following way (maybe it's a wrong way
with Akka):
a "server" publisher of actors available to remote consumers (like an
EJB server), and a "client" that does the lookup and consume remote
actors.
I know that the code is full of tests/commented code etc, I'll clean
up when all works as expected :-) ; because my priority here is to
migrate Java code in the Groovy version, and then use in as a sample
in my Grails-Akka Plugin (where I already have some minimal Groovy
Shell scripts as a sample, but not working with remote).

> I think it would be great if you can first try with the Activator sample Akka Remote Samples with Java and then add minimal things until it does not work as you expect.
ok, I'll try even this ... but from what I see in the code you never
lookup a remote actor directly from an Akka System,

Here is the source code of that Activator tutorial that use actorSelection to lookup remote actor: https://github.com/akka/akka/blob/v2.3.9/akka-samples/akka-sample-remote-java/src/main/java/sample/remote/calculator/LookupActor.java
 
could it be this
my pitfall ? If it is, is there a good reason for this behavior ?
Sorry but I didn't find a clear answer/example to this question, even
after reading a lot of docs and blogs on Akka ...

> system.actorSelection and context.actorSelection should both work.
the strange thing here is that using the published actor directly from
system.actorSelection (using the Java API) I get exception during
actor creation (but only when calling it via remote), but really I
don't understand what could be.

Neither did I. I have never seen that issue before and therefore I wanted to try your sample, but...
If you can create a minimized version of the problem I can try again, but I highly recommend that you start from something that works, i.e. the Activator tutorial.

/Patrik
 
Maybe only some more info on this (in Akka documentation, really
helpful) can help me and others.

Akka is really a great framework, but it needs rethinking of some
things, thanks for the patience :-) ...

Thanks for now,
Sandro

--
>>>>>>>>>>      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.
Reply all
Reply to author
Forward
0 new messages