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 8662503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:44:59+00:00 2026-06-12T16:44:59+00:00

I am working on a play framework 2 system using java .The play framework

  • 0

I am working on a play framework 2 system using java .The play framework uses the akka system integrated with play framework to connect with a remote akka system. the remote akka system is made up of a master node and a worker node. Both systems are on the same computer with eclipse juno IDE
I have configured two ports 2552 for the master node and port 2553 for the worker node.the akka node on the play 2 framework is selected by the system itself. the akka system in the play framework is expected to ppass a messgae to the remote master node by remote lookup using the akka configuration. the master node interns also pass the message to the remote worker for processing by a remote lookup as well. The master node and the worker node have thier application.conf files in the following formart :

src/main/resources/application.conf

however on start up both the master node and the worker node decide to use port number 2552 for their communication. I present the code snippets below :

this i the code for the play framewrok application.config file.

localNode {
    akka {
        actor {
            provider = "akka.remote.RemoteActorRefProvider"
        }
        remote {
            transport = "akka.remote.netty.NettyRemoteTransport"
            netty {
                hostname = "127.0.0.1"
                port = 0
            }
        }
    }
}

this is the configuation for the play localNode

package controllers;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;

import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;

import play.libs.F.Callback;
import play.mvc.WebSocket;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.serialization.Serialization;
import akka.serialization.SerializationExtension;

import com.typesafe.config.ConfigFactory;
import  Com.RubineEngine.GesturePoints.*;

public class LocalNode  {

    ActorSystem csystem;
    ActorRef localActor ;


    public LocalNode() { 

       //We create the actor container and a child upon initialization 
     csystem = ActorSystem.create("LocalNode", ConfigFactory.load().getConfig("localNode"));
     localActor = csystem.actorOf(new Props(LocalActor.class),"localActor");
    }


     public void connectMaster (final String classname)
     {  
         localActor.tell(classname);

     }

     public  void connectMaster ()
     {  

     }


     public void connectMaster (final WebSocket.In<JsonNode> in, final WebSocket.Out<JsonNode> out )
     {        
             in.onMessage(new Callback<JsonNode>() {
             public void invoke(JsonNode event) throws JsonParseException, JsonMappingException, IOException {                 

            ObjectMapper mapper = new ObjectMapper();               

            @SuppressWarnings("unchecked")
            Map<String,ArrayList<Object>> jsonMap = mapper.readValue(event, Map.class); 
            GesturePoints gp = new GesturePoints();

            gp.setPoints(jsonMap);
            localActor.tell(gp);            
             }
          });     } 
}           

this is the code for the akka actor in the play framework

package controllers;


import Com.RubineEngine.GesturePoints.*;

import akka.actor.ActorRef;
import akka.actor.UntypedActor;
import akka.event.Logging;
import akka.event.LoggingAdapter;

public class LocalActor extends UntypedActor {

     /**
     * 
     */

    ActorRef masterActor; // = getContext().actorFor("akka://MasterNode@127.0.0.1:2552/user/masterActor");
     LoggingAdapter log = Logging.getLogger(getContext().system(), this);

    @Override
    public void onReceive(Object arg) throws Exception {
        System.out.println(" Local Actor 1");
          if(arg instanceof GesturePoints)
         {  System.out.println(" local Actor 2");
              masterActor.tell(" Welcome home " , getSelf());   
              System.out.println(" Local Actor 3");}    
         else 
         {unhandled(arg);}
    }


    public void preStart()
    {
      masterActor = getContext().actorFor("akka://MasterNode@127.0.0.1:2553/user/masterActor");
    }
}

this is the code for the Master node application.conf

masterNode {

akka {
  actor {
    provider = "akka.remote.RemoteActorRefProvider"
  }
  remote {
    transport = "akka.remote.netty.NettyRemoteTransport"
    netty {
      hostname = "127.0.0.1"
      remote.netty.port = 2553
    }
 }
}
}

this is the code for the master node

package Rubine_Cluster;

import java.util.Arrays;

import com.typesafe.config.ConfigFactory;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.kernel.Bootable;

/**
 * Hello world!
 *
 */
public class MasterNode implements Bootable
{
     final ActorSystem system;
     ActorRef masterActor;

      public MasterNode() {

        //Create a child actor of this actor upon initialization 
        system = ActorSystem.create("MasterNode", ConfigFactory.load()
            .getConfig("masterNode"));
         masterActor = system.actorOf(new Props(MasterActor.class),"masterActor");  

      }


      public void startup() {

      }

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

this is the code for the master akka actor

package Rubine_Cluster;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Map;

import Com.RubineEngine.GesturePoints.*;
import akka.actor.*;
import akka.serialization.Serialization;
import akka.serialization.SerializationExtension;
import akka.serialization.Serializer;





public class MasterActor extends UntypedActor {

    /**
     * 
     */

    ActorRef worker1;



    @Override
    public void onReceive(Object message) throws Exception {
        System.out.println(" Master Actor 5");
        System.out.println(message);

         if(message instanceof GesturePoints)
         {  //GesturePoints gp = (GesturePoints) message;
              System.out.println(" Master Actor 1");             
         try {      worker1.tell(message, getSelf());

             System.out.println(" Master Actor 2");
                } catch (Exception e) {
                  getSender().tell(new akka.actor.Status.Failure(e), getSelf());
                  throw e;
                }

    }
         else{ unhandled(message);}
  }  

    public void preStart()
    {
      worker1 = getContext().actorFor("akka://WorkerNode@127.0.0.1:2552/user/workerActor");
    }

}

this is the code for the worker node application.conf

workerNode {

akka {
  actor {
    provider = "akka.remote.RemoteActorRefProvider"
  }
  remote {
    transport = "akka.remote.netty.NettyRemoteTransport"
    netty {
      hostname = "127.0.0.1"
      remote.netty.port = 2552
    }
 }
}
}

this is the code for the worker nide

package com.theta.gesture;

import com.typesafe.config.ConfigFactory;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.kernel.Bootable;


public class WorkerNode implements Bootable{
   ActorSystem system;
   ActorRef worker;

   WorkerNode(){
       system = ActorSystem.create("WorkerNode", ConfigFactory.load()
                .getConfig("workerNode"));
            ActorRef workerActor = system.actorOf(new Props(WorkerActor.class),"workerActor");              
}


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

    }

    public void startup() {
    }       
}

this is the code for the actor in the worker project

package com.theta.gesture;

import java.util.ArrayList;
import java.util.Map;

import Com.RubineEngine.GesturePoints.GesturePoints;
import akka.actor.*;

public class WorkerActor extends UntypedActor {

     private static double              DIST_SQ_THRESHOLD   = 3 * 3; /* threshold to eliminate mouse jitter */

    @Override
    public void onReceive(Object msg) throws Exception {

         if(msg instanceof GesturePoints) 
         { GesturePoints message = (GesturePoints) msg;
          initial_Theta(message);}  

         else {unhandled(msg);}
    }

    public void initial_Theta(GesturePoints p)
    {       System.out.println(" Worker Actor 1");          
        if(p.getPoints().get("X").size() < 3)  //The number of x coordinates as size
        {   return;}                     

        System.out.println(" Worker Actor 2");
             double magsq,dx,dy, recip;

             dx = (double) ((Integer)p.getPoints().get("x").get(2)  - (Integer)p.getPoints().get("x").get(0)) ;
             dy = ((Double)p.getPoints().get("y").get(2)) - ((Double)p.getPoints().get("y").get(0));

             magsq = dx * dx + dy * dy;  
             if(magsq  > DIST_SQ_THRESHOLD)
             {
                 recip = 1/Math.sqrt(magsq);
                double  initial_cos = dx * recip;

                System.out.println(" Worker Actor 3");
                double  initial_sin = dy * recip;

                 System.out.println("Feature cos  " + initial_cos);
                 System.out.println("Gesture sin  " + initial_sin);
             } 
         }  }

this is the console information on the Worker Node

[INFO] [10/08/2012 12:12:44.486] [main] [ActorSystem(WorkerNode)] REMOTE: 
RemoteServerStarted@akka://WorkerNode@127.0.0.1:2552

this is the console information on the master nODE

[INFO] [10/08/2012 12:13:34.633] [main] [ActorSystem(MasterNode)] REMOTE:  
RemoteServerStarted@akka://MasterNode@127.0.0.1:2552

any idea about the possible course of this situation and a suggested solution is dearly sought after

  • 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-12T16:45:01+00:00Added an answer on June 12, 2026 at 4:45 pm

    Your “remote.netty.port = X” inside the nested sections should be “port = X”

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

Sidebar

Related Questions

i am working on project using play 2 framework with java. I want to
I am working on Play Framework 2.0 and it uses Jerkson to parse JSON
i'me working on a web server using play framework 2.0, where the login is
I have a working Play Framework project. I'm using Play Framework version number 1.2.5
I have a very old linux system and installed java and play framework. When
I am working on a Play Framework project and I am using SecureSocial plugin
I am using the Secure module from play framework and its mostly working great.
I am working on a play 2.0 framework application in java. I want to
An app I'm working on using the Play! Framework has an object called gift
I've been working on a Play framework social networking application, and I've come across

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.