"Address already in use" for all ports in debug.xml

spatel9 years ago

Hi,

I just recently started testing this and I haven't really made any changed yet except for changing File structure so the XML files are inside "resources". This way I can make a maven (mvn package) build and it builds with the necessary files.

So I've moved debug.xml and all three XML files from database folder to "/src/main/resources" folder.

When I try to build using IntelliJ or maven command line, I get the following error:

Exception in thread "main" org.jboss.netty.channel.ChannelException: Failed to bind to: 0.0.0.0/0.0.0.0:5092 at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272) at org.autotracking.TrackerServer.start(TrackerServer.java:116) at org.autotracking.ServerManager.start(ServerManager.java:57) at org.autotracking.Main.main(Main.java:17) Caused by: java.net.BindException: Address already in use at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:433) at sun.nio.ch.Net.bind(Net.java:425)...

If I comment out adm.port (5092) from debug.xml, I get the same error for one of the other port. And so on. If I comment out all ports, it runs fine on 8082 or 8080. Is there something I am doing?

Thank you.
Smit P.

Anton Tananaev9 years ago

You need to check what process is using those ports.

spatel9 years ago

I checked. I am using a Mac and I run the following command to check:

lsof -i tcp:5092

It says java. If I stop it and try again, I get the same error.
Also, It's not like java is running on ALL 108 or so ports.

It happens for EVERY port listen there but 8080 or 8082 works just fine when I comment out all other ports.

Anton Tananaev9 years ago

Java process probably means you already have another instance of Traccar running.

spatel9 years ago

I really doubt that. In my IDE, I have setting for "Single Instance only". So when do I run it, it stops the previous one.

Also, I've already shut down all processes, restarted the laptop and tried everything to stop the other instance if there is one. No luck.

Is there any other way I can check if there another instance is running?

Thanks.

Anton Tananaev9 years ago

Just check the process and the full information about that process (especially command full line info).

Dragan7 years ago

I have the same issue on macOS Sierra.
I have trued to change ports but always the same error. Do port scanning and assure that no app using give ports but the errors remains.
@spatel,
how did you fix it?

p.s.
I am using macOS Siera, java 1.8
Here is my log file: https://gist.github.com/gandra/2ff4a99bc96256032990d482b0a69f14

Anton Tananaev7 years ago

Check what other process uses port 5003.

Dragan7 years ago

I have scanned ports:
Ports in use

and then replaced config to use another ports - 5031 instead of 5001 and 5033 instead of 5003 and the error remains:

Port conf

Her is the error on another ports:

Exception in thread "main" org.jboss.netty.channel.ChannelException: Failed to bind to: 0.0.0.0/0.0.0.0:5033
    at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)
    at org.traccar.TrackerServer.start(TrackerServer.java:117)
    at org.traccar.ServerManager.start(ServerManager.java:81)
    at org.traccar.Main.main(Main.java:38)
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.Net.bind(Net.java:425)
Anton Tananaev7 years ago

You have changed ports to other ones that Traccar already uses... not sure how you expect it to fix the problem.

Dragan7 years ago

@tananaev,
you are right. Didn't see that this port is in use. After changing it to unused port I have succed to run it.
Thanks!

vindiaa year ago

please help me when i enter localhost:8082 in browser traccar page dont load

2023-10-10 12:38:19  WARN: Port disabled due to conflict - Address already in use: bind - BindException (...)
2023-10-10 12:38:20  INFO: jetty-11.0.15; built: 2023-04-11T18:37:53.775Z; git: 5bc5e562c8d05c5862505aebe5cf83a61bdbcb96; jvm 18.0.2.1+1-1
2023-10-10 12:38:20  INFO: Started o.t.w.@4b448d7e{/,null,AVAILABLE}
2023-10-10 12:38:20  INFO: Session workerName=node0
2023-10-10 12:38:20  WARN: JAXBContext implementation could not be found. WADL feature is disabled.
2023-10-10 12:38:21  INFO: Started o.e.j.s.ServletContextHandler@a298dbe{/,null,AVAILABLE}
2023-10-10 12:38:21  INFO: Started ServerConnector@13631338{HTTP/1.1, (http/1.1)}{0.0.0.0:8082}
2023-10-10 12:38:21  INFO: Started Server@5316aaf8{STARTING}[11.0.15,sto=0] @10571ms
vindiaa year ago

in source code where i can change port so that traccar page can be load in browser

vindiaa year ago

when i want to change port to

    /**
     * Web interface TCP port number. By default Traccar uses port 8082. To avoid specifying port in the browser you
     * can set it to 80 (default HTTP port).
     */
    public static final ConfigKey<Integer> WEB_PORT = new IntegerConfigKey(
            "web.port",
            List.of(KeyType.CONFIG),
            8083);

it dont reflect there

2023-10-10 15:09:17  WARN: JAXBContext implementation could not be found. WADL feature is disabled.
2023-10-10 15:09:18  INFO: Started o.e.j.s.ServletContextHandler@368c73a0{/,null,AVAILABLE}
2023-10-10 15:09:18  INFO: Started ServerConnector@7863364b{HTTP/1.1, (http/1.1)}{0.0.0.0:8082}
2023-10-10 15:09:18  INFO: Started Server@3fc021a0{STARTING}[11.0.15,sto=0] @12964ms
Anton Tananaeva year ago

First of all, asking on a 6 year old thread is probably not a good idea to start with.

As for the port, it can be set in the config file. You obviously don't need to change any code for that.