Configuring the application server remote connection IDEA

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 Hostremote server address, Portthe debug port 60222, and select the module needs to be debugged, click OKFinish.
Configuration example IDEA

3. Start debug

Click the button to start the IDEA debug.
debug button
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.
Create debug configuration page
Server configuration parameters.
Server
Configuring Startup / Connection parameters, click OKFinish.
Startup/Connection

3. Start debug

Click the button to start the IDEA debug.
debug button
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 60222to view the port occupancy.

 

Guess you like

Origin www.linuxidc.com/Linux/2019-07/159637.htm