Breaking News
Loading...
Friday, 24 May 2013

Remote debugging in eclipse: Failed to connect to remote VM. Connection refused. Connection refused: connect

5/24/2013 09:56:00 am
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.

Step 1:

    Set up the project in eclipse.

Step 2:

     Deploy the project to Tomcat 7.

Step 3: 

     Start the application in Tomcat.

Step 4:

      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

     
Step 5:

      Give a Name and select the project to be debugged.
      Set
  •  host: ip address of computer on which Tomcat 7 is running, if it is on same machine you can use
          "localhost".
  • port: 8000
     

  • Then in source tab add the necessary projects and click "Apply".
 Step 6:
  
     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.


1 comments:

  1. Thank you so much... It worked out like a charm! :)

    ReplyDelete

 
Toggle Footer