Tomcat uses idea remote Debug debugging

Source: Internet
Author: User

Tomcat operating Environment: CentOS6.5, Tomcat7.0, Idea

Remote Tomcat settings

1, in the Tomcat/bin under the catalina.sh Add the following section of the settings

CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=60222,suspend=n,server=y"

2. address=60222 This is the debug port you need to use when you set up the idea, you can set up an unused port at any time, but the configuration behind is consistent.

Idea Settings

1. Add Tomcat server to select remote

2, set the corresponding parameters

    • xxx.xxx.152.67:8080 is the IP address and port of the remote Tomcat server, where the domain name can be set, for example: http://security.xxxx.cn/login.do;

    • 60222 This port is set in 1.1 Steps of the debug port, the port suitable for Tomcat is not the same;

    • The remote staging here selects the same file system, which requires the code of the local code and the remote tomcat to be kept;

3, Startup/connection

Select Debug, Socket, debug port this is 60222.

4. Select Run

Then click Debug on the right to run (first tomcat to start)

5, whether successful

You can see that the connection is successful,

View the Tomcat server log as follows:

6. If the failure

    • If a port is denied:

This may be if Tomcat is not started or if the error stops, restarting Tomcat

    • Connection failure, other issues

First look at the debug port on the server side here is the usage of 60222

[[email protected]_92_170_centos bin]# lsof -i:60222COMMAND   PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAMEjava    12064 root    5u  1320209      0t0  1x.xxx.xxx.170:60222->1xx.xx.xxx.231:13325 (ESTABLISHED)

You can see that this is a local and remote connection, if the connection fails to see the above usage, use the kill-9 PID to kill the process, restart Tomcat, and then re-run debug in Idea,
This example is: kill-9 12064

Tomcat uses idea remote Debug debugging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.