最近在新的公司,突然遇到使用 resion服务器的情况,因为在做开发时通常要debug, 因此需要配置一下resion 的 debug 端口。废了老长时间,终于把这个问题搞定,下面将resion3.0和4.0的debug 端口的配置贴出来,希望能帮助遇到问题的同学。
resion 3.0 debug 端口的开启:
打开cmd,然后再resion的根目录下面找到httpd.exe 启动 httpd.exe 时加入一下参数,如下所示:

httpd.exe -Xmn100M -Xms500M -Xmx500M -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787
这样就顺利的启动resion 3.0 的debug 端口了,端口号是:8787。
然后没有没有集成 resion服务器到IDE的同学就可以,配置remote debug 功能了,也实现了IDE和服务器分离的情况下远程的debug 调试功能。
resion 4.0 的debug端口开启 配置如下:

在4.0 下面,首先要找到 resion.xml 文件,然后再找到其中的 id = "app" 的 cluster 那么就可以在这个
cluster 配置的最前面加入以上的代码,注意一定是在这个cluster的最前面加入这段代码。如下:
<server-default>
<jvm-arg>-Xnoagent</jvm-arg>
<jvm-arg>-Xdebug</jvm-arg>
<jvm-arg>-Djava.compliler=NONE</jvm-arg>
<jvm-arg>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787</jvm-arg>
</server-default>
那么当你下次重新的启动的时候就会看到debug 的端口已经开启了。
当然了,前提是你的这个 cluster 下面配置你的应用的虚拟主机目录。
整个cluster的配置如下:
<cluster id="app">
<server-default>
<jvm-arg>-Xnoagent</jvm-arg>
<jvm-arg>-Xdebug</jvm-arg>
<jvm-arg>-Djava.compliler=NONE</jvm-arg>
<jvm-arg>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787</jvm-arg>
</server-default>
<!-- define the servers in the cluster -->
<server-multi id-prefix="app-" address-list="${app_servers}" port="6800"/>
<host-default>
<!-- creates the webapps directory for .war expansion -->
<web-app-deploy path="webapps"
expand-preserve-fileset="WEB-INF/work/**"
multiversion-routing="${webapp_multiversion_routing}"
path-suffix="${elastic_webapp?resin.id:''}"/>
</host-default>
<!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
<host-deploy path="hosts">
<host-default>
<resin:import path="host.xml" optional="true"/>
</host-default>
</host-deploy>
<!-- 前端 -->
<host id="front.yigao.dev" root-directory="">
<web-app id="/" root-directory="D:/project/dest/business"/>
</host>
<resin:if test="${resin_doc}">
<host id="${resin_doc_host}" root-directory="${resin_doc_host}">
<web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>
</host>
</resin:if>
</cluster>
本文详细介绍了如何在Resin3.0和4.0中配置debug端口,包括通过命令行参数启动Resin3.0的debug端口,以及在Resin4.0的resin.xml文件中进行相应的配置。
278

被折叠的 条评论
为什么被折叠?



