eclipse 远程debug

1.debug ant target

<target name= "debugTask" >
    <java classname= "com.emobile.test.util.Test"  fork= "true" >
      <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8099,server=y,suspend=y" />
       <classpath>
          <pathelement location= "${build.classes.dir}"  />
          <path refid= "compile.classpath"  />
       </classpath>
    </java>
</target>

2.tomcat debug


S1、设置环境变量CATALINA_OPTS
    在catalina.bat的开始位置,添加以下内容: 
    rem ********************* 设置Tomcat remote debug *************************************
    SET CATALINA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
    rem ***********************************************************************************

S2、启动tomcat
    使用startup.bat启动tomcat,在eclipse中使用tomcat插件启动则无效。

S3、配置eclipse,
    run->open debug dialog->Remote Java Application,进行相应配.
    host是tomat所在的地址
    端口号是上面设置的端口(8787)

S4、执行代码
    代码执行后,即可进入debug状态。在设置断点的地方,系统会停止,等待下一步执行。


3.debug JBOSS

 找到JBOSS_HOME/bin目录下的run.conf文件,找到:

    #JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"

    将其修改为:

    JAVA_OPTS="$JAVA_OPTS -Xdebug     -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

 4.debug Weblogic

Setting up Debug Configuration for Weblogic Server.

Here will be given instructions on how to setup Weblogic with remote debugging enabled. Accomplish the following steps to enable application debugging:

  1. Locate startWebLogic.cmd ("...\domains\nechodomain\bin\startWebLogic.cmd") and add the following variable DEBUG_OPTS:
         
         
    ...
    @REM Set debug options
    set DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n
    echo starting weblogic with the following debug options: %DEBUG_OPTS%
    @REM START WEBLOGIC
    ...
  2. Next, insert the new variable to the WebLogic startup command, after "%JAVA_HOME%\bin\java" and preferably before the other options. Your startup script should look like:
         
         
    ...
    %JAVA_HOME%\bin\java %DEBUG_OPTS% %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -Dweblogic.Name=%SERVER_NAME% -
    Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy %PROXY_SETTINGS% %SERVER_CLASS%
    ...

This should enable remote debugging functionality for Weblogic. To check that remote debugging port is open, after starting Weblogic server from the command line run: "netstat /a" and make sure that the debugging port (1044) presents in the list of the opened ports.



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值