java.net.BindException: Address already in use

For help and support with issues specific to Linux/Unix
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

java.net.BindException: Address already in use

Postby egant » Mon May 04, 2009 5:34 am

System info:
1- your computer specs (cpu, memory) and the precise server version you're using - Intel Core2 Duo CPU 2.40GHz and 4GB Ram running openSUSE 11.0 (X86-64)
2- the network connection you are using for streaming your files (wifi, homeplugs, ethernet 100Mbits, or gigabit) - WiFi G and 100Mbps exhibits the issue
3- detailed infos on what's not working - log file repeats "UPNP network exception: Address already in use" every 1 second during normal operation.

I see this error in my debug.log every second. i have disabled avahi services on host and upnp on local router but to no avail. the output of netstat or lsof doesn't show port 5001 bound to another process. this is creating a large debug.log, and i am trying to keep logging to a minimum (on a CF hosted root filesystem). has anybody seen this behavior?
egant
 
Posts: 2
Joined: Thu Jan 22, 2009 9:30 pm

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

Postby shagrath » Mon May 04, 2009 11:58 am

seems a firewall or antivirus issue to me
shagrath
Project Lead
 
Posts: 2668
Joined: Wed Jan 14, 2009 1:39 pm

Re: java.net.BindException: Address already in use [RESOLVED]

Postby egant » Tue May 05, 2009 5:29 am

Log file printed this error every second while PMS was running (whether serving / transcoding content or not)

[Thread-11] TRACE 23:47:51.701 java.net.BindException: Address already in use
[Thread-11] TRACE 23:47:51.702 at java.net.PlainDatagramSocketImpl.bind0(Native Method)
[Thread-11] TRACE 23:47:51.702 at java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:77)
[Thread-11] TRACE 23:47:51.702 at java.net.DatagramSocket.bind(DatagramSocket.java:369)
[Thread-11] TRACE 23:47:51.703 at java.net.MulticastSocket.<init>(MulticastSocket.java:165)
[Thread-11] TRACE 23:47:51.703 at java.net.MulticastSocket.<init>(MulticastSocket.java:130)
[Thread-11] TRACE 23:47:51.703 at net.pms.network.UPNPHelper$2.run(UPNPHelper.java:205)
[Thread-11] TRACE 23:47:51.704 at java.lang.Thread.run(Thread.java:636)

From http://code.google.com/p/ps3mediaserver/source/browse/trunk/ps3mediaserver/net/pms/network/UPNPHelper.java#205

it shows 1900 as the port being requested, but I was mistakenly looking for a port conflict on port 5001.
The output of netstat --nape --inet |grep 1900 on my machine showed: udp 0 0 0.0.0.0:1900 0.0.0.0:* 1000 11223 3985/ktorrent

I shutdown ktorrent and re-ran the netstat command to see this output: udp 0 0 0.0.0.0:1900 0.0.0.0:* 0 352562 25787/java
At which point the "java.net.BindException: Address already in use" error messages stopped. Restarting the ktorrent application and checking "netstat -nape --inet |grep 190[0-9]" outputs:

udp 0 0 0.0.0.0:1900 0.0.0.0:* 0 352562 25787/java
udp 0 0 0.0.0.0:1901 0.0.0.0:* 1000 353949 26895/ktorrent

Seems the ktorrent application was able to grab another port because PMS had 1900.
egant
 
Posts: 2
Joined: Thu Jan 22, 2009 9:30 pm

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

Postby XferMe » Fri Jan 21, 2011 3:28 am

In my case it was a Hamachi client blocking port 1900.

The best way to figure this out on Windows is:
Code: Select all
start -> run -> cmd

in cmd window:
Code: Select all
netstat -ano


There you will see a list of ports and IP's. You ought to find a 1900 port ie:
Code: Select all
...
UDP 0.0.0.0:5000 *:* 5040
UDP 0.0.0.0:1900 *:* 3140
UDP 0.0.0.0:3702 *:* 2000
...

The last column is Process ID (in this case 3140) and you can find the process id in Task Manager and kill that process or configure the process to use other port.

All the best,
Milos
XferMe
 
Posts: 2
Joined: Fri Jan 21, 2011 3:20 am

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

Postby MastricX » Tue Feb 01, 2011 11:10 pm

This started happening to me recently too, I can kill Hamachi-2.exe and it will work fine. Anyone more familar with Hamachi know how to change this or why it started happening recently?
MastricX
 
Posts: 5
Joined: Sun Mar 01, 2009 11:10 pm

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

Postby WrinkledCheese » Wed May 01, 2013 1:39 am

I am running into this issue on a Linux box. Unfortunately, I'm not how in the day when it happens and my computer un-savvy girlfriend is barely able to restart the server let alone run a command line command.

The next time it happens I will try and capture some logs but does anyone know what might cause this on a linux box that doesn't have anything else running network wise?
WrinkledCheese
 
Posts: 6
Joined: Sat Apr 28, 2012 8:10 pm

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

Postby chocolateboy » Wed May 01, 2013 5:59 pm

chocolateboy
Project Member
 
Posts: 2580
Joined: Wed Sep 16, 2009 10:05 am


Return to Linux/Unix Support

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests