java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind (JBOSS)
This problem occurs on some Windows systems that have the IPv6 TCP Stack installed. If both IPv4 and IPv6 are installed on the computer, the Java Virtual Machine (JVM) may have problems closing or opening sockets at the operating system level.
Add the following JVM option: -Djava.net.preferIPv4Stack=true
I've seen this happen on Windows 7 and Windows 2008 systems which have both IPv4 and IPv6 stacks installed by default.
I ran into the same issue on Win7 trying to implement the example here: http://download.oracle.com/javase/tutorial/networking/sockets/clientServer.html
The default port in the example code is 4444. Using this port I got "Unrecognized Windows Sockets error: 0: JVM_Bind"
I changed the port to 44444 and tried again. I got a popup from the Windows Firewall service asking me if this application had permission to access the network. Selecting OK I no longer get the error message when I launch my server.
After some experimenting I found that with a port of 5000 or less I would get the JVM_Bind error. Any port of 5001 or above would bind without issue.
You have very likely another process already bound on a port that JBoss is using (8080?) and this prevent JBoss from starting correctly (see this page for a list of ports used by JBoss).
Either find the conflicting process and shut it down:
- use
netstat -a -o -n
and look for ports used by JBoss (e.g. 8080) and the correspondingpid
- then use
tasklist /FI "PID eq <pid>"
to find the process
Or change JBoss defaults ports. There are several ways to do that but the best way is to use the Service Binding Manager (see detailed instructions in Configuring Multiple JBoss Instances On One Machine).