When debugging Web applications, often you need to use ide remote connection to the debug. Use Springboot built-in server and the Tomcat server using a common application deployment can be configured in different ways to start a remote debug mode.
Springboot application
1. Start configuration parameters
2. Configure IDEA
As shown in the pop configuration page, click on the upper left corner of +
numbers add debug configuration page, configure the Host
remote server address, Port
the debug port 60222, and select the module needs to be debugged, click OK
Finish.
3. Start debug
Click the button to start the IDEA debug.
While waiting for the console print out the following information, said that it has started successfully, at this time, when accessing applications on a remote server, it can be intercepted IDEA breakpoints to.Connected to the target VM, address: '192.168.94.23:60222', transport: 'socket'
Tomcat Application
1. Start configuration parameters
catalina.sh top in the tomcat / bin is added below the set periodCATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=60222,suspend=n,server=y"
2. Configure IDEA
As shown in the pop configuration page, click on the upper left corner of +
numbers add Tomcat Server, select Remote.
Server configuration parameters.
Configuring Startup / Connection parameters, click OK
Finish.
3. Start debug
Click the button to start the IDEA debug.
While waiting for the console print out the following information, said that it has started successfully, at this time, when accessing applications on a remote server, it can be intercepted IDEA breakpoints to.Connected to the target VM, address: '192.168.94.23:60222', transport: 'socket'
If you start debug fails, there may be a debug port is occupied by the command
netstat -anp | grep 60222
to view the port occupancy.