如何用Eclipse在Resin中调试Web应用程序

廖雪峰 / 文章 / ... / Reads: 1466 Edit

本文介绍如何在Resin + Eclipse环境中调试Web应用程序。测试环境为Windows 7 / Resin 3.2 / Eclipse 3.3

在Resin的resin.conf中找到并添加加以下参数:

<resin xmlns="http://caucho.com/ns/resin"
    xmlns:resin="http://caucho.com/ns/resin/core">
    <log name="" level="info" path="stdout:"/>
    <cluster id="">
        <root-directory>.</root-directory>
        <server-default>
            <http server-id="" host="*" port="80"/>
            <jvm-arg>-Xmx128m</jvm-arg>
            <jvm-arg>-Xss1m</jvm-arg>
            <jvm-arg>-Xdebug</jvm-arg>
            <jvm-arg>-Xnoagent</jvm-arg>
            <jvm-arg>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12345</jvm-arg>
...

启动Resin后,打开Eclipse项目,选择 Run ->Debug... -> Remote Java Application -> New

新建一个Remote Java Application,填入Host: 127.0.0.1, Port: 12345, 注意这个Port就是Resin启动的address参数。

现在,就可以利用Eclipse强大而方便的调试界面对Web App断点调试并跟踪了!

Comments

Make a comment

Author: 廖雪峰

Publish at: ...

关注公众号不定期领红包:

加入知识星球社群:

关注微博获取实时动态: