Remote debug in Tomcat 6

2019-06-18 18:59发布

问题:

Does anyone know the steps to configure remote debugging in Tomcat 6 for GWT applications?

IDE - Eclipse

Sever - Tomcat6

Tech - GWT

I have gone through the following link, but it was not clear for me.

http://wiki.apache.org/tomcat/FAQ/Developing

I have done the following things:

  1. Placed the project war in 'Catalina_Home/webapps/project' which I wanted to debug remotely.
  2. Opened tomcat6w.exe and pasted java option under java tab as follows:

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

  3. Clicked on start. After starting the server, I have opened eclipse the configure the remote debugging with port 8000 and click on Debug.

  4. I have got the error message back saying that Failed to connect to remote VM. Connection refused.

Is there anything else that I am missing here. Please correct me if I am wrong any where.

回答1:

Use command line, go to your Tomcat folder ..\Tomcat6\bin and write command:

catalina jpda start

Wait until Tomcat will run (You will see something like) :

Then in eclipse: Debug -> Debug configuration -> Remote Java Application -> New

Browse a project and debug!



回答2:

Use the following :

"-Xdebug" and "-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" in two different lines, without qoutes in tomcat6w.exe > Java tab > Java Options (before everything else) and apply.

Then you just need to configure a Remote Java Application profile in Debug Configuration of Eclipse for your project and point it to the same jpda port.