| Summary: | JDT Debug Jvm_bind exception when clicking debug second time | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Andy <bchrist2> |
| Component: | Debug | Assignee: | JDT-Debug-Inbox <jdt-debug-inbox> |
| Status: | RESOLVED NOT_ECLIPSE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Michael_Rennie, samrat.dhillon, zboosy |
| Version: | 3.7 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Andy
Get this pop up as well: Cannot connect to VM Unrecognized Windows Sockets error: 0: JVM_Bind (In reply to comment #1) > Get this pop up as well: > > Cannot connect to VM > Unrecognized Windows Sockets error: 0: JVM_Bind I'm not sure what the TestNGLaunchConfigurationDelegate is, but it is not provided by JDT debug. From the looks of your trace though you are trying to start listening on the same port more than once, hence the bind exception. I encounter this bug while running VPN software (netmotion) and debugging with eclipse 3.7 on Jdk 1.6.0_29. If I run eclipse using JDK 1.7 this bug is not encountered. Perhaps this was a bug in Jdk 1.6 itself. I do see that when eclipse starts the debugger it tries to find a free port using org.eclipse.jdt.launching.SocketUtil findFreePort method. The method looks like
public static int findFreePort() {
ServerSocket socket= null;
try {
socket= new ServerSocket(0);
return socket.getLocalPort();
} catch (IOException e) {
} finally {
if (socket != null) {
try {
socket.close();
} catch (IOException e) {
}
}
}
return -1;
}
Should it be something like?
public static int findFreePort() {
ServerSocket socket= null;
try {
socket= new ServerSocket(0);
socket.setReuseAddress(true);
return socket.getLocalPort();
} catch (IOException e) {
} finally {
if (socket != null) {
try {
socket.close();
} catch (IOException e) {
}
}
}
return -1;
}
If adding Thead.sleep(5) after findFreePort() call, it will work. Not sure this is a JDK issue or OS issue. I have colleagues have same issue. we are on 64 machine, jdk and eclipse both 64. |