Starting Tomcat with remote debugging (jdwp) when installed as Windows service

I have Tomcat installed as a windows service. I would like to configure it to support remote debugging via jdwp.

When running from the command line (catalina.bat), I can add this line to enable debugging:

-agentlib:jdwp=transport=dt_socket,suspend=n,server=y,address=10000

      

Where can I add jdwp support when running it as a windows service? For the purposes of this question, I don't want to use the Tomcat Monitor application, but rather configure it through some file like server.xml, catalins.properties, etc.

+2


source to share


2 answers


Steps to start the Windows Tomcat service in debug mode:

1) Go to the directory under the Tomcat bin folder
2) C: \ Program Files (x86) \ Apache Software Foundation \ Tomcat 7.0 \ bin
3) Run tomcat7w.exe
4) Under Options Java / java "enter the lines above all parameters -D
    -Xdebug
    -Xrunjdwp: transport = transport over sockets, address = 8000, server = y, hang = n



Make sure the above two lines are on separate lines.

+4


source


see this manual and change the provided service.bat to include the following line:

set JVM_OPTIONS=-Djava.io.tmpdir=%TMPDIR%;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed;-Xms256M;-Xmx512M;-Xmixed;-Xincgc;-Xdebug;-Xrunjdwp:transport=dt_socket,server=n,suspend=y,address=127.0.0.1:4153

      



this is the first JVM_OPTIONS setting. make sure you don't overwrite the parameters already set.

run service.bat as usual to install debug service

+2


source







All Articles