How to start debug mode from command line for apache tomcat server?

I want to start debug mode for my application. But I need to start debug mode from the command line. Is it possible? And will this procedure change between tomcat 5.5 and tomcat 6.?

+71
java tomcat
May 22 '13 at 10:20
source share
8 answers
In windows
$ catalina.bat jpda start 
On Linux / Unix
 $ catalina.sh jpda start 

Additional Information https://cwiki.apache.org/confluence/display/TOMCAT/Developing

+104
May 22 '13 at 10:24
source share

For the first Windows variables:

 set JPDA_ADDRESS=8000 set JPDA_TRANSPORT=dt_socket 

To start the server in debug mode:

 %TOMCAT_HOME%/bin/catalina.bat jpda start 

For the first export unix variables:

 export JPDA_ADDRESS=8000 export JPDA_TRANSPORT=dt_socket 

and start the server in debug mode:

 %TOMCAT_HOME%/bin/catalina.sh jpda start 
+43
04 Oct '13 at
source share
  • From your IDE, create a remote debug configuration, configure it for the standard JPDA Tomcat port, which is port 8000.

  • At the command line:

    Linux:

     cd apache-tomcat/bin export JPDA_SUSPEND=y ./catalina.sh jpda run 

    Window:

     cd apache-tomcat\bin set JPDA_SUSPEND=y catalina.bat jpda run 
  • Set up remote debugging from your IDE, and Tomcat will start, and now you can set breakpoints in the IDE.

Note:

The JPDA_SUSPEND=y is optional, useful if you want Apache Tomcat to not run it until step 3 is completed, useful if you want to fix problems with application initialization.

+19
Feb 12 '14 at 19:23
source share

The short answer is to add the following parameters when starting the JVM.

 JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8080" 
+11
Apr 05 '16 at 7:48
source share

First go to the TOMCAT-HOME/bin .

Then run the following command at a command prompt:

 catalina.bat jpda start 

If the Tomcat server is running Linux, just run catalina.sh

 catalina.sh jpda start 

Same for Tomcat 5.5 and Tomcat 6

+4
May 22 '13 at 10:22
source share

There are two ways to start Tomcat in debug mode.

  1. Using jdpa run

  2. Using JAVA_OPTS

Set up your environment first. Then start the server using the following commands.

 export JPDA_ADDRESS=8000 export JPDA_TRANSPORT=dt_socket %TOMCAT_HOME%/bin/catalina.sh jpda start sudo catalina.sh jpda start 

refer to this article for more information, this clearly define it

+1
May 21 '15 at 9:26
source share

These instructions helped me on apache-tomcat-8.5.20 on Mac OS 10.13.3 using jdk1.8.0_152:

 $ cd /path/to/apache-tomcat-8.5.20/bin $ export JPDA_ADDRESS="localhost:12321" $ ./catalina.sh jpda run 

Now connect to port 12321 from IntelliJ / Eclipse and enjoy remote debugging.

+1
Mar 08 '18 at 5:31
source share

Inside catalina.bat, set the port on which you want to run the debugger

 if not "%JPDA_ADDRESS%" == "" goto gotJpdaAddress set JPDA_ADDRESS=9001 

Then you can just start the debugger with

 catalina.bat jpda 

Now, from Eclipse or IDEA, select remote debugging and start debugging by connecting to port 9001.

0
Apr 15 '14 at 6:26
source share



All Articles