Remote debugging in eclipse:
Failed to connect to remote VM. Connection refused.
Connection refused: connect
For using remote debugging in eclipse with Tomcat 7 follow the steps below.
Set up the project in eclipse.
Deploy the project to Tomcat 7.
Start the application in Tomcat.
Set the debug points in eclipse.
In Eclipse go to Run --> Debug Configurations
In the left pane right click on Remote Java Application and select New
Give a Name and select the project to be debugged.
- host: ip address of computer on which Tomcat 7 is running, if it is on same machine you can use
- port: 8000
- Then in source tab add the necessary projects and click "Apply".
Click on "Debug" and debug your application.
There is chance that you should end up with a
"Failed to connect to remote VM. Connection refused."
"Connection refused: connect"
error. To solve this download the zip version of Tomcat 7 and copy the files in the bin folder
(except bootstrap, Tomcat7, Tomcat7w and tomcat-juli) to the bin folder of Tomcat 7 you are
using. Then edit the startup.bat file in bin folder (with notepad or any editor) so that replace the
"start" command at the end of the file with "jpda start" and save the file. Then stop the
Tomcat 7 and start it by double clicking "startup.bat" file that you are edited, now Tomcat will
run in remote debugging mode.