Search code examples
javaeclipsetomcatspring-tool-suiteeclipse-rap

Remote Debugging in STS and org.eclipse.jdi.TimeoutException


Getting below error when I try to do the remote debug in Spring Tool Suite IDE.

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

I followed the below steps to enable the remote debugging

  1. deployed the war file in Tomcat server 8.
  2. set up the env variable "JAVA_OPTIONS" value (-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8080,server=y,suspend=n)
  3. start server by the command "CATALINA jpda start"
  4. once server started
  5. In IDE, Run --> Debug Configurations --> Remote Java Application, create new application with the same project and host is localhost and port is 8080.

Note: I improved my STS.ini memory to -Xms768m, -Xmx768m but unsuccessful.

not sure why my remote debugging is not working.


Solution

  • I guess Tomcat itself is running on port 8080, therefore I would recommend to use a different port for the debugging setup (-Xrunjdwp:transport=dt_socket,address=4000, for example). Then connect your remote debugging session in STS/Eclipse to that port.