转载

IDEA 远程调试 spring war tomcat

1. 新增Remote Configuration

IDEA 远程调试 spring war tomcat

IDEA 远程调试 spring war tomcat

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

2.配置Tomcat

配置服务器Tomcat

进入$TOMCAT_HOME/bin目录下

vi catalina.sh
#在# OS specific support.上面添加
export JAVA_OPTS='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005'

重启Tomcat

./shutdown.sh

./startup.sh

3.将war包部署到服务器上

4.开启端口

vi /etc/sysconfig/iptables 
#在-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT之后添加
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5005 -j ACCEPT

如果嫌麻烦或者对安全要求不高直接关闭防火墙也行

service iptables stop

5223

原文  http://www.waitingfy.com/archives/5223
正文到此结束
Loading...