tomcat与ANT远程调试

tomcat与ANT远程调试

tomcat要远程调试,其实比较简单,就是在tomcat/bin/下面加入了一个文件
setenv.bat
文件内容如下:
SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
然后点击startup.bat就可以了。

但是最近用的appfuse是用ant来启动tomcat,于是加入了这两个ant任务:
<!--    ========================================  -->
<!--    add by Luohua start a remote debug        -->
<!--    ========================================  -->
<target name="tomcat.debug" description="Install application in Local Tomcat">
         <echo message="start debug tomcat ..." />              
         <exec executable="${tomcat.home}/bin/startup.bat" os="Windows XP" spawn="true" vmlauncher="false">
             <arg line="/c start ${tomcat.home}/bin/startup.bat" />
         </exec>
</target>
<!--    ========================================  -->
<!--    add by Luohua stop a remote debug         -->
<!--    ========================================  -->
<target name="tomcat.stop" description="Install application in Local Tomcat">
    <echo message="stop debug tomcat ..." />
    <exec executable="cmd" os="Windows XP" vmlauncher="false">
         <arg line="/c start ${tomcat.home}/bin/shutdown.bat" />
      </exec>         
</target>

你可能感兴趣的:(tomcat,ant,socket,Appfuse)