java.net.BindException while building a remote Application

226 views
Skip to first unread message

Banduk

unread,
Feb 10, 2012, 12:08:51 PM2/10/12
to Akka User List
Hi guys,

I am using the 2.0-M3 version of Akka, scala-2.9.1 and sbt-0.11.2.
I'm having some problems to configure my remote communication.
Let's see if someone can help me!


My server runs perfectly, but when I try to run the client, who's
gonna create the actors on the server side, I get this BindException

[info] Running com.remoteTest.remote.app
[DEBUG] [02/10/2012 17:52:56.192] [run-main] [EventStream(akka://
Appli...@172.16.33.7:2552)] logger log1-Logging$DefaultLogger
started
[DEBUG] [02/10/2012 17:52:56.195] [run-main] [EventStream(akka://
Appli...@172.16.33.7:2552)] Default Loggers started
[error] (run-main) org.jboss.netty.channel.ChannelException: Failed
to bind to: /172.16.33.7:2552
org.jboss.netty.channel.ChannelException: Failed to bind to: /
172.16.33.7:2552
....
Caused by: java.net.BindException: Address already in use
....

I tried, then to build this aaplication using the sources from the
package "jboner-akka-34d9714", as it was an example and it worked!
As the .conf files used are the same in both cases so I guess this is
a problem concerning my project configuration (by the way, they look
very similar to the one of akka-sample-remote)
I'm posting my "AkkaBuild.scala" file below for you guys to try to
help me to find the problem. I wrote the file based on the the one
used to build the sample applications.

[FILE]
import sbt._
import sbt.Keys._
import java.lang.Boolean.getBoolean

object AkkaBuild extends Build {

// Settings
lazy val baseSettings = Defaults.defaultSettings

lazy val parentSettings = baseSettings ++ Seq(
publishArtifact in Compile := false
)

lazy val buildSettings = Seq(
organization := "com.company",
version := "0.1",
scalaVersion := "2.9.1"
)

lazy val remoteSample = Project(
id = "firstRemoteScalaProject",
base = file("."),
settings = defaultSettings
)

lazy val defaultSettings = baseSettings ++ Seq(
resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/
releases/",

libraryDependencies += "com.typesafe.akka" % "akka-actor" % "2.0-
M3",
libraryDependencies += "com.typesafe.akka" % "akka-remote" % "2.0-
M3",
libraryDependencies += "com.typesafe.akka" % "akka-kernel" % "2.0-
M3",
libraryDependencies += "io.netty" % "netty" % "3.3.0.Final"
)
}
[/FILE]

Thank you,
Regards,
Banduk

Jeremy Pierre

unread,
Feb 10, 2012, 1:23:19 PM2/10/12
to akka...@googlegroups.com
Hi Banduk,

Saw this same problem when I first started doing some Akka remote
actor development, it's likely very simple. Are you running two
microkernels on the same machine? If so, you're probably booting the
same "server" class on both and they're both trying to bind to port
2552(or whatever you've set the "remote" port to). Check the "boot"
line in akka.conf for the client you wrote or change the port number
for your client microkernel in the "remote" section.

Hope that helps,

Jeremy

> --
> You received this message because you are subscribed to the Google Groups "Akka User List" group.
> To post to this group, send email to akka...@googlegroups.com.
> To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
>

rkuhn

unread,
Feb 10, 2012, 3:08:03 PM2/10/12
to akka...@googlegroups.com
With M4 you could also just set the akka.remote.netty.port=0 on the client to use an automatically chosen one.

Regards,

Roland

> To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.

Banduk

unread,
Feb 10, 2012, 3:50:10 PM2/10/12
to Akka User List
Thanks guys,

I don't have access to my files during the weekend but I'll let you
know if your suggestions works once I can test!

Regards,
Banduk
> > > Applicat...@172.16.33.7:2552)] logger log1-Logging$DefaultLogger
> > > started
> > >  [DEBUG] [02/10/2012 17:52:56.195] [run-main] [EventStream(akka://
> > > Applicat...@172.16.33.7:2552)] Default Loggers started
> > akka-user+...@googlegroups.com.

Banduk

unread,
Feb 13, 2012, 4:28:19 AM2/13/12
to Akka User List
Hi,

Just to let you know. I tested both solutions which worked like a
charm!
I decided to continue using the version M4, so the solution proposed
by Roland fits better to my case.

Thank you again,
Banduk

√iktor Ҡlang

unread,
Feb 13, 2012, 4:32:57 AM2/13/12
to akka...@googlegroups.com
Excellent,

happy hAkking!

Cheers,
--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

√iktor Ҡlang

unread,
Oct 17, 2012, 8:14:36 AM10/17/12
to akka...@googlegroups.com


On Wed, Oct 17, 2012 at 1:12 PM, Manohar Manjunath <manohar....@gmail.com> wrote:
Hi Guys,
 
I tried setting port to 0 and still end up getting the same exception.
Any hints as to what could be the possible problem?

If I could guess what your problem is without neither code nor output, I would be a very awesome guy indeed.

Cheers,
 
 
Looking for urgent help in this regard
 
Regards
Manohar
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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 post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages