Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote Debugging in eclipse

I have an application running in server A. The dev environment is in server B. I am trying to do remote debugging of app running in server A.

In server A i added following command to service start script

-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4554,server=y,suspend=n

And service is running in server A.

When i try to launch remote debugging configuration it gives

Failed to connect to remote VM. Connection refused. Connection refused

port 4554 is free in server A.

What other configuration need to be done for this?

Regards Dheeraj Joshi

like image 826
Dheeraj Joshi Avatar asked Dec 03 '10 13:12

Dheeraj Joshi


People also ask

What is remote debugging in Java?

Remote Java Debugging is the process of debugging a Java program or application running on another machine or a server environment.

What is remote debugging?

Remote debugging is when you debug an application running in a place or environment different from your local machine in a way that resembles local debugging. The point of this is for developers to debug components of distributed systems without difficulty.

How do I run debugging in Eclipse?

Starting the Debugger. To debug your application, select a Java file with a main method. Right-click on it and select Debug As Java Application. If you started an application once via the context menu, you can use the created launch configuration again via the Debug button in the Eclipse toolbar.


2 Answers

Try this.

  1. Set suspend=y, just to make sure you got the JVM line right. This should stop the VM on startup until you connect.
  2. If you're on Unix, bring up the terminal and try telnet [host] [port] - this will quickly let you know if there's anything listening to that port on that host.
  3. Make sure the connection properties in Eclipse are set correctly. Note that the port defaults to 8000.
  4. Use the IP address instead of the host name, to rule out DNS/hostfile problems.

Run properties in eclipse

Another way of starting the JVM that I use successfully is:

-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y
like image 164
Martin Algesten Avatar answered Nov 09 '22 00:11

Martin Algesten


Check if there is a firewall between and/or on the two servers.

like image 38
snowflake Avatar answered Nov 09 '22 00:11

snowflake