29

Running Apache Tomcat as a Windows Service for Remote Debugging

 5 years ago
source link: https://www.tuicool.com/articles/hit/Bby6Nni
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

NbuEziY.png!web

Download Apache Tomcat

  • Go directly to the  Apache Tomcat Site , select the version you prefer for download. 
  • However, it is always advised to use the latest version unless you have a constraint or a specific reason.
  • Select the  32-bit/64-bit Windows Service Installer  version

ENbE7ru.png!web

  • Execute the install as a regular installation.
  • Go the installed file location -> bin and run  Tomcat8w.
    • The Tomcat executable will start a Tomcat instance instead of the service management window.
  • The Tomcat Service Window will appear:

22MVJz3.png!web

Here you can start stop the Tomcat service and manage the properties.  Moreover, you can set the start-up type of the Tomcat server to either Manual or Automatic depending on where the service will start when your system starts up.

Apache Tomcat Configuration for Debugging

  • Go to the Java tab :

JfqaAvM.png!web

  • Add the following under the Java options area:
    • Xdebug
    • Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

Here you can even set the environment related variable for Java as well.

Restart the Tomcat server and then it will be ready for remote debugging through port 8000.

Note: Here it seems the jpda run is not working as expected when it is set under the startup tab.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK