zoukankan      html  css  js  c++  java
  • eclipse 远程调试

    远程调试Java应用

     http://blog.sina.com.cn/s/blog_6e2d53050101j9wy.html

    http://www.cnblogs.com/HighFun/archive/2013/06/06/3120256.html

    在java-config 中增加如下配置

    debug-enabled="true" debug-options="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9009"


    其中,suspend的用途:

    如果为N,则表示java应用可以先启动运行,然后远程debug可以随时再连接。启动glassfish的日志如下

    D:glassfish-3.1.2.2glassfish3glassfishin>asadmin start-domain
    Waiting for domain1 to start ...
    Successfully started the domain : domain1
    domain  Location: D:glassfish-3.1.2.2glassfish3glassfishdomainsdomain1
    Log File: D:glassfish-3.1.2.2glassfish3glassfishdomainsdomain1logsserver.
    log
    Admin Port: 4848
    Debugging is enabled.  The debugging port is: 9009
    Command start-domain executed successfully.
    
    D:glassfish-3.1.2.2glassfish3glassfishin>


    如果为Y,则java应用会先挂起,应用无法访问,一直等待远程debug的连接,启动glassfish的日志如下:

    D:glassfish-3.1.2.2glassfish3glassfishin>asadmin start-domain
    Debugging is enabled and the server is suspended.  Please attach to the debuggin
    g port at: 9009
    Waiting for domain1 to start ......


    然后在Eclipse 中开启远程debug,可以调试,并且应用也可以访问,glassfish追加日志如下:

    D:glassfish-3.1.2.2glassfish3glassfishin>asadmin start-domain
    Debugging is enabled and the server is suspended.  Please attach to the debuggin
    g port at: 9009
    Waiting for domain1 to start ............................
    Successfully started the domain : domain1
    domain  Location: D:glassfish-3.1.2.2glassfish3glassfishdomainsdomain1
    Log File: D:glassfish-3.1.2.2glassfish3glassfishdomainsdomain1logsserver.
    log
    Admin Port: 4848
    Debugging is enabled.  The debugging port is: 9009
    Command start-domain executed successfully.
    
    D:glassfish-3.1.2.2glassfish3glassfishin>

     在Eclipse 配置 remote debug 时,  注意下面的单选框。如果选了,在remote debug 时,如果点击“Terminal”, 会导致java应用的停止,所以此处不要勾选

  • 相关阅读:
    DELPHI 画报表 画表头 stringgrid控件
    蜂巢 Thinking in Agile 我们需要怎样的软件过程(1)
    小博一周年了 将开源进行到底
    Windows Mobile下实现图片的3D效果
    蜂巢 Thinking in Agile 我们需要怎样的软件过程(2)
    Windows 中各种 dll 的导出功能
    以下代码中的两个sizeof用法有问题吗?
    sizeof和strlen
    以下反向遍历array数组的方法有什么错误?
    找错题
  • 原文地址:https://www.cnblogs.com/SamuelSun/p/5912528.html
Copyright © 2011-2022 走看看