tags:

views:

547

answers:

1

I have a Tomcat installed as a Windows service. I'd like to configure it to support remote debugging via jdwp.

When starting it from the command line (catalina.bat), I can add this string to allow debugging:

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

Where can I added jdwp support when running it as a windows service? For the purpose of this question, I do not want to use the "Monitor Tomcat" application, but rather configure it via some file like server.xml, catalins.properties, etc ...

+1  A: 

see this how-to and modify 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 setting of the JVM_OPTIONS. make sure you dont overwrite options already set.

run the service.bat as usual to install the debug service

mkoryak