Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.4.0 attempts to bind to port 8081 in addition to specified port #85

Open
screed01 opened this issue Oct 23, 2016 · 1 comment

Comments

@screed01
Copy link

NOTE: This issue does not exist with amazon-echo-bridge-0.2.1.jar.

I have OpenHab up and running and listening on port 8081. When I attempt to run the bridge on port 8082 (and have tried 8091 with no luck either), it fails to start. Here is my command:

java -jar amazon-echo-bridge-0.4.0.jar –upnp.config.address=192.168.168.5 –server.port=8082

The log shows the bridge attempting to bind to three ports:
2016-10-23 12:24:29.990 INFO 5828 — [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8082 (http) 8081 (http) 8082 (http)

And it fails trying to bind to the already used 8081 port:
2016-10-23 12:24:42.660 ERROR 5828 — [ main] o.a.coyote.http11.Http11NioProtocol : Failed to initialize end point associated with ProtocolHandler [“http-nio-8081”]

java.net.BindException: Address already in use: bind

@jlekhter
Copy link

jlekhter commented Oct 29, 2016

Yeah, this version opens 3 ports by default starting with the value of --emulator.portbase+1. So if you set the value of emulator.portbase to 8082, you should see that it starts on 8082, then opens up two more ports on 8083 and 8084. If you set portbase, you should be fine.

The code should have probably defaulted portbase to server.port since in the current setting, if you change server.port to 8082 and dont modify portbase, tomcat tries to start on 8082, 8081, 8082 which causes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants