"Cannot connect to VM" while Debugging [message #142074] |
Tue, 07 March 2006 16:27 |
Eclipse User |
|
|
|
Originally posted by: kai.hannemann.gmx.net
I'm using WinXP SP2, newest eclipse, newest jdk.
Debugging worked just fine until today. I wanted to debug a simple
application and get the message "Cannot connect to VM" when hitting debug.
There are no details available (button greyed out).
I'm pretty sure I didn't change any settings concerning windows, eclipse
or java.
To resolve the problem I already tried the following:
* trying to debug in Windoes safe mode
* using system restore back to a date where everything was still working
* deinstalled and reinstalled jdk
* reinstalled eclipse
Nothing worked. I have no idea what happened and I have no other idea left
than to completely reinstall my OS.
Any ideas would be gratly appreciated!
|
|
|
|
Re: "Cannot connect to VM" while Debugging [message #142092 is a reply to message #142087] |
Tue, 07 March 2006 17:19 |
Eclipse User |
|
|
|
Originally posted by: kai.hannemann.gmx.net
David Karr wrote:
> First, are you trying to connect to a remote or internal VM?
I'm not using a remote VM.
> I'm not too familiar with what Eclipse does with an internal VM, but you
> should be able to look at similar information. In general, make sure your
> JDK is listening on the port you expect, and your client is the only
> connecting to that listener.
I don't really know how to do all that.
Here's what tcpview says when I hit "debug"
proc: javaw.exe:2740
protocol: tcp
local adress: 0.0.0.0:1453
remote adress: 0.0.0.0:0
state: listening
Are ports even concerned when I don't use a remote VM?
btw: I have no firewall installed. so there can't be blocked anything.
|
|
|
|
Re: "Cannot connect to VM" while Debugging [message #142144 is a reply to message #142098] |
Tue, 07 March 2006 22:28 |
Eclipse User |
|
|
|
Originally posted by: kai.hannemann.gmx.net
> Even local debug sessions use a socket connection. WinXP SP2 has a built
> in firewall. Have you tried disabling it?
The service is disabled. I can guarantee there's no firewall active.
> What VM are you running?
I don't know exactly. Converning java I only istalled the latest jdk from
sun.
How can I find out what VM I'm running?
>Are the target and host VM's the same?
Again how do I find out what target and host VM I'm using?
|
|
|
Re: "Cannot connect to VM" while Debugging [message #142153 is a reply to message #142144] |
Tue, 07 March 2006 22:40 |
Eclipse User |
|
|
|
Originally posted by: kai.hannemann.gmx.net
OK I just found out where the logfile is.
This is the full log of the error:
!ENTRY org.eclipse.jdt.launching 4 120 2006-03-07 16:59:47.296
!MESSAGE Cannot connect to VM
!STACK 0
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at java.net.ServerSocket.<init>(ServerSocket.java:97)
at
org.eclipse.jdi.internal.connect.SocketTransportService.star tListening(SocketTransportService.java:275)
at
org.eclipse.jdi.internal.connect.SocketTransportImpl.startLi stening(SocketTransportImpl.java:47)
at
org.eclipse.jdi.internal.connect.SocketListeningConnectorImp l.startListening(SocketListeningConnectorImpl.java:108)
at
org.eclipse.jdt.internal.launching.StandardVMDebugger.run(St andardVMDebugger.java:196)
at
org.eclipse.jdt.launching.JavaLaunchDelegate.launch(JavaLaun chDelegate.java:101)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:590)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:515)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:733)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlu gin.java:931)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
|
|
|
Re: "Cannot connect to VM" while Debugging [message #142163 is a reply to message #142074] |
Tue, 07 March 2006 23:38 |
Eclipse User |
|
|
|
Originally posted by: e0326320.student.tuwien.ac.at
Kai Hannemann wrote:
> I'm using WinXP SP2, newest eclipse, newest jdk.
> Debugging worked just fine until today. I wanted to debug a simple
> application and get the message "Cannot connect to VM" when hitting debug.
> There are no details available (button greyed out).
I have exactly the same problem!!!! I have the same system (winXP, sp2).
> Nothing worked. I have no idea what happened and I have no other idea left
> than to completely reinstall my OS.
> Any ideas would be gratly appreciated!
I hope someone has a solution for this problem, this problem is really
annoying...
|
|
|
|
|
Re: "Cannot connect to VM" while Debugging [message #142253 is a reply to message #142206] |
Wed, 08 March 2006 20:52 |
Eclipse User |
|
|
|
Originally posted by: kai.hannemann.gmx.net
Kevin Barnes wrote:
> If you haven't explicitly specified the VM, it will use the default.
> Enter "java -version" on the command line to get the details of the VM
> your host uses.
it says:
"java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)"
> The VM used by your target is specified on the JRE tab in the Launch
> Configuration Dialog.
it's pointed to the directory where I isntalled the latest jre to.
> We use the following method to find an available port.
> 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;
> }
> What do you get if you run that code?
Before a fresh restart: 1985
Everytime i rerun the code the ports increses by 1
After a fresh restart: 1055 also increases by 1 everytime it's rerun
|
|
|
Re: "Cannot connect to VM" while Debugging [message #142273 is a reply to message #142233] |
Wed, 08 March 2006 21:19 |
Eclipse User |
|
|
|
Originally posted by: kai.hannemann.gmx.net
> Ok, this means that some other process (or another part of Eclipse,
> theoretically) has created a server socket on that port. Before you start
> Eclipse, run "netstat -a" and search for something listening on your JPDA
> port (was it 1453?). That will only tell you if something is listening,
> but not necessarily what. You could use the TCPView application from
> Sysinternals to give you a graphical view of what netstat shows, along
> with the owning process.
Here's what happens when I hit debug in eclipse: javaw opens an (unused)
serversocket (the one Kevin Barnes' code would return), listens at this
port and keeps listening. So when I hit debug 20 times i get 20 entries in
tcpview of javaw listening on different ports.
I made a screenshot for illustration (some ips removed)
http://img482.imageshack.us/img482/852/ports3pw.jpg
|
|
|
|
Powered by
FUDForum. Page generated in 0.10809 seconds