在linux下使用resin进行远程调试 博客分类: linux resin 远程调试
linux下实现resin远程调试有两种方式(address是远程调试监控的端口号):
1.将下面加入到启动脚本当中:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9998
2.在resin.xml中加入下面粗体部分即可
<server-default>
<!-- The http port Xmx=Xms Xmn=Xmx/3-->
<http address="0.0.0.0" port="80"/>
<jvm-arg>-Xmx1024m</jvm-arg>
<jvm-arg>-Xss1m</jvm-arg>
<jvm-arg>-Xmn512m</jvm-arg>
<jvm-arg>-Xms1024m</jvm-arg>
<jvm-arg>-XX:MaxNewSize=256m</jvm-arg>
<jvm-arg>-XX:MaxPermSize=512m</jvm-arg>
<jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>
<watchdog-jvm-arg>-Dcom.sun.management.jmxremote</watchdog-jvm-arg>
<watchdog-port>6600</watchdog-port>
<memory-free-min>1M</memory-free-min>
<thread-max>40960</thread-max>
<socket-timeout>65s</socket-timeout>
<keepalive-max>10240</keepalive-max>
<keepalive-timeout>65s</keepalive-timeout>
<!-- Debug -->
<jvm-arg>-Xdebug</jvm-arg>
<jvm-arg>-Xnoagent</jvm-arg>
<jvm-arg>-Djava.compiler=NONE</jvm-arg>
<jvm-arg>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9998</jvm-arg>
</server-default>
然后在eclipse里配置一下 Remote java Application ,填写resin所在的主机地址, 端口写9998 ,就能远程调试了。
注意:确保本地代码和远程服务代码一致,端口独占,不能同时供多个人同时调试