idea remote debugging tomcat web service

1: Preparation

In this download package thrown into the war in tomcat, after the start and then you can by ip:port/appname/hellorunning visit, we started following it. Download the
source code here .

2: Configure tomcat

Add the following content in catalina.sh
linux/mac::

export JAVA_OPTS='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005'

windows:

set CATALINA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8443

address=Replace the note with your actual port number.
The screenshot below is what I configured: After the
Insert picture description here
configuration is complete, throw the war package to tomcat, then start the server, first test that the startup is normal:
Insert picture description here

3: Configure idea

In Edit Configurationsdirect operations according to the screenshot:
Insert picture description here
Then configure the screenshot described in:
Insert picture description here

4: Debugging test

Note that the remote tomcat has been started normally before this step, directly debug and start, as shown in the figure below, it is successful:
Insert picture description here
Then, just like local debugging, break the point, visit, and you can start local debugging, as follows:
Insert picture description here

5: The way to use the domain name

5.1: Configure hosts

127.0.0.1 www.sublimetext.com

5.2: Modify the idea configuration

As shown in the figure below:
Insert picture description here
debugging is as follows:
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/wang0907/article/details/112059162
Recommended