Remote Debugging: Failed to connect to remote VM. Connection timed out
Asked Answered
U

5

10

I was remote debugging with Eclipse on my Ubuntu VM fine to a remote WebLogic application, then it stopped working. I have debug turned on in the remote server. From my VM I'm able to telnet into the remote debugging port. I've tried restarting Eclipse and setting the network connection to Direct. It just keeps timing out.

Failed to connect to remote VM. Connection timed out.
org.eclipse.jdi.TimeoutException

In .log:

!MESSAGE Failed to connect to remote VM. Connection timed out.
!STACK 0
org.eclipse.jdi.TimeoutException
    at org.eclipse.jdi.internal.connect.SocketTransportService.attach(SocketTransportService.java:162)
    at org.eclipse.jdi.internal.connect.SocketTransportImpl.attach(SocketTransportImpl.java:45)
    at org.eclipse.jdi.internal.connect.SocketAttachingConnectorImpl.attach(SocketAttachingConnectorImpl.java:134)
    at org.eclipse.jdt.internal.launching.SocketAttachConnector.connect(SocketAttachConnector.java:141)
    at org.eclipse.jdt.internal.launching.JavaRemoteApplicationLaunchConfigurationDelegate.launch(JavaRemoteApplicationLaunchConfigurationDelegate.java:84)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
    at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Unconstitutional answered 10/12, 2014 at 16:24 Comment(10)
So you have java options set for your server like: set JAVA_OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n Have you tried restarting the server? Not enough details in your question to help...Depository
I have debugFlag=true. That sets all the the options you mentioned. The default address is 8453. I used that and I'm currently using 888. I see in the server log "Listening for transport dt_socket at address: 8888" so it is listening. I can telnet in at that address but when connecting through Eclipse it times out. I also tried it from Windows with the same result.Unconstitutional
How is this different than a question you asked years ago: #13960758Depository
The question is different. Look at the error message. In that case the connection was refused. Here it's timing out and I set the debugFlag. The server is listening on that debug port.Unconstitutional
"Connection refused" has a specific meaning in TCP, and it's not about timeouts. Your question title says "connection refused" but you say it's timing out? Which is it?Foot
@Kenster, Oh, the very last time it failed it must have been a connection refused, which I copied and pasted. I've restarted and I'm back to the timeout. I've updated the title and pasted in the full error in the description.Unconstitutional
"Connection timed out" usually means you don't have routing from the client to the server, or a firewall is blocking packets. Could you describe the network connectivity between the host you're running eclipse on and this Ubuntu VM? If you're using VMWare or Virtualbox to run Ubuntu, how are the Ubuntu VM's network interfaces configured?Foot
@Kenster, I'm using Ubuntu with Virtualbox, but I'm also getting the same error in Windows. In both environments I'm able to hit the WebLogic admin console, and the application, in addition to telnet to the server's debug port.Unconstitutional
So you're running the JVM in a Virtualbox Ubuntu guest, and you're running eclipse on the host trying to connect to the JVM's debug port? Is that right? What network interfaces does the guest have, and how are they configured in Vbox? E.g. are they NAT, host-only network, something else? What actual IP address are you trying to connect to from eclipse?Foot
@Kenster, no I'm trying to connect to some remote server in both cases. I just switched to Windows to try to rule out any problem with my VM that may be causing the issue. The actual IP address I'm connecting to is on a VPN.Unconstitutional
U
13

I bumped up the debug timeout (Windows/Preferences/Java/Debug/Communication/Debugger timeout) and restarted both the admin server and the managed server where the application is deployed and is listening on the debug port.

Unconstitutional answered 10/12, 2014 at 23:30 Comment(0)
Y
4

Recently I got the same problem, and this is what I found after solved it. If the configuration is wrong from the remote server side, the message should be "connection refused" not "timeout". Besides, "timeout" also does not see any wireshark packets, while "refused" gives: enter image description here

Finally I found that the network connection of the "timeout" Eclipse is manually configured. You can check this under window->preferences->general->network connections. If it is "manual" (like what I had) change it to "native".

Yuki answered 28/1, 2016 at 2:42 Comment(0)
D
0

set java.property.debug=true in the property file may help you.

Dionisio answered 9/10, 2015 at 5:34 Comment(0)
L
0

** I solved it setting in Eclipse And STS(Spring Tool Suits): Just edit this configuration inside your IDE(Eclipse or Sts) increase your timeout time value by two zero it would be enough. enter image description here Windows --> Preferences --> Java --> Debug --> Debugger timeout: 10000t**

Lebensraum answered 26/5, 2021 at 9:33 Comment(0)
P
0

make sure port number is same as debug port number

set JPDA_ADDRESS=8000

port number for connecting your server

Petronille answered 18/11, 2022 at 7:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.