Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8549217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:40:39+00:00 2026-06-11T13:40:39+00:00

I am running sample example for akka remoting (2.0.2) in java (1.6) and not

  • 0

I am running sample example for akka remoting (2.0.2) in java (1.6) and not getting results from remote. It seems that my local node is not able to connect to remote note.

LocalNodeApplication code is on local system and RemoteNodeApplication code is on remote system.

Please refer code :

Local Node –

public class LocalNodeApplication extends Controller {

public static Result process(String msg) throws Exception {

    ActorSystem _system = ActorSystem.create("LocalNodeApp", ConfigFactory.load().getConfig("LocalSys"));
    ActorRef localActor = _system.actorOf(new Props(LocalActor.class));

    localActor.tell("Hello");

    Thread.sleep(5000);
    _system.shutdown();

    return ok("success");
}

}

LocalActor code :

public class LocalActor extends UntypedActor {
LoggingAdapter log = Logging.getLogger(getContext().system(), this);
Timeout timeout = new Timeout(Duration.parse("5 seconds"));

ActorRef remoteActor;

@Override
public void preStart() {
    //Get a reference to the remote actor

    remoteActor = getContext().actorFor("akka://RemoteNodeApp@192.168.0.85:9002/user/remoteActor");
}

@Override
public void onReceive(Object message) throws Exception {
    Future<Object> future = Patterns.ask(remoteActor, message.toString(), timeout);

    String result = (String) Await.result(future, timeout.duration());

    log.info("Message received from Server -> {}", result);

    /*remoteActor.tell(message.toString());*/
}

}

LocalSys config :

LocalSys {
akka {
    actor {
        provider = "akka.remote.RemoteActorRefProvider"
        deployment {
            /remoteActor {
                remote = "akka://RemoteNodeApp@192.168.0.85:9002"
            }
        }
    }
}

}


Remote Node code –

RemoteNodeApplication

public class RemoteNodeApplication implements Bootable {

final ActorSystem system = ActorSystem.create("RemoteNodeApp", ConfigFactory.load().getConfig("RemoteSys"));

public void shutdown() {
    system.shutdown();
}

public void startup() {     
    system.actorOf(new Props(RemoteActor.class), "remoteActor");
}

}

RemoteActor :

public class RemoteActor extends UntypedActor {
@Override
public void onReceive(Object message) throws Exception {
    if (message instanceof String) {
        // Get reference to the message sender and reply back
        getSender().tell(message + " got something");
    }
}

}

RemoteSys config –

RemoteSys {
akka {
    actor {
        provider = "akka.remote.RemoteActorRefProvider"
    }
    remote {
        untrusted-mode = on
        transport = "akka.remote.netty.NettyRemoteTransport"
        netty {
            hostname = "192.168.0.85"
            port = 9002
        }
    }
}

}


I am starting play “run 9000” on local node and on remote starting play “run 9002” .

I am getting below mentioned exception :

[INFO] [09/17/2012 17:42:52.206] [play-akka.actor.actions-dispatcher-1] [ActorSystem(LocalNodeApp)] REMOTE: RemoteServerStarted@akka://LocalNodeApp@127.0.0.1:2552
[INFO] [09/17/2012 17:42:52.406] [LocalNodeApp-akka.actor.default-dispatcher-4] [ActorSystem(LocalNodeApp)] REMOTE: RemoteClientStarted@akka://RemoteNodeApp@192.168.0.85:9002
[INFO] [09/17/2012 17:42:52.438] [LocalNodeApp-akka.actor.default-dispatcher-1] [ActorSystem(LocalNodeApp)] REMOTE: RemoteClientShutdown@akka://RemoteNodeApp@192.168.0.85:9002
[ERROR] [09/17/2012 17:42:57.281] [LocalNodeApp-akka.actor.default-dispatcher-4] [akka://LocalNodeApp/user/$a] Timed out
    akka.pattern.AskTimeoutException: Timed out
        at akka.dispatch.DefaultPromise.result(Future.scala:875)
        at akka.dispatch.Await$.result(Future.scala:74)
        at akka.dispatch.Await.result(Future.scala)
        at com.localNodeApp.LocalActor.onReceive(LocalActor.java:30)
        at akka.actor.UntypedActor$$anonfun$receive$1.apply(UntypedActor.scala:154)
        at akka.actor.UntypedActor$$anonfun$receive$1.apply(UntypedActor.scala:153)
        at akka.actor.Actor$class.apply(Actor.scala:318)
        at akka.actor.UntypedActor.apply(UntypedActor.scala:93)
        at akka.actor.ActorCell.invoke(ActorCell.scala:626)
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197)
        at akka.dispatch.Mailbox.run(Mailbox.scala:179)
        at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:516)
        at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259)
        at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975)
        at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1479)
        at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
Caused by: akka.pattern.AskTimeoutException: Timed out
        at akka.pattern.PromiseActorRef$$anonfun$1.apply$mcV$sp(AskSupport.scala:274)
        at akka.actor.DefaultScheduler$$anon$6$$anon$7.run(Scheduler.scala:183)
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:94)
        at akka.jsr166y.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1381)
        ... 4 more
 [INFO] [09/17/2012 17:42:57.318] [LocalNodeApp-akka.actor.default-dispatcher-4] [ActorSystem(LocalNodeApp)] REMOTE: RemoteServerShutdown@akka://LocalNodeApp@127.0.0.1:2552

When I am running the same example on local system for both local node and remote node (for this changed IP address to local system) getting below mentioned lines on console :

[INFO] [09/17/2012 17:42:52.206] [play-akka.actor.actions-dispatcher-1] [ActorSystem(LocalNodeApp)] REMOTE: RemoteServerStarted@akka://LocalNodeApp@127.0.0.1:2552
[INFO] [09/17/2012 17:42:52.406] [LocalNodeApp-akka.actor.default-dispatcher-4] [ActorSystem(LocalNodeApp)] REMOTE: RemoteClientStarted@akka://RemoteNodeApp@192.168.0.85:9002
[INFO] [09/17/2012 17:42:52.438] [LocalNodeApp-akka.actor.default-dispatcher-1] [ActorSystem(LocalNodeApp)] REMOTE: RemoteClientShutdown@akka://RemoteNodeApp@192.168.0.85:9002
[INFO] [09/17/2012 17:42:57.318] [LocalNodeApp-akka.actor.default-dispatcher-4] [ActorSystem(LocalNodeApp)] REMOTE: RemoteServerShutdown@akka://LocalNodeApp@127.0.0.1:2552

Please guide me on this.
Am I following right steps for akka remoting ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:40:41+00:00Added an answer on June 11, 2026 at 1:40 pm

    the remoteapplication need to be deployed as jar in the akka
    microkernal. Once the remote application starts, you can run the local
    application to connect to the remote app. answered by write2munish

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made small sample example in jws that is running on local machine. I
i have a simple example of a JList that is getting it's data from
I am running a sample push notification example.I have done the c2dm signup and
I'm running a sample application that has a map component to it. The app
I am running a simulation that takes a sample of values in a matrix
I'm trying to sample an integer texture from my geometry shader running on a
I'm running the twisted.words MSN protocol example from the Twisted documentation located here: http://twistedmatrix.com/projects/words/documentation/examples/msn_example.py
I just downloaded wxPython, and was running some of the sample programs from here
Can anyone post a sample code wherein theres a running timer(javascript settimeout) and doing
i have application who use specific process during running and i want to sample

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.