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
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