tomcat

./catalina.sh jpda start

这条命令启动tomcat,它就会监听8000端口,等待调试器的连接。

默认监听8000端口,通过设置环境变量JPDA_ADDRESS指定监听端口

例如,监听8001端口:

export  JPDA_ADDRESS=8001

catalina.sh jpda start

Java

For newer JDK :

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6006

address指定监听端口

对于1.5及以上jdk,推荐使用上述命令。对于1.3及1.4jdk,使用命令如下:

For JDK 1.3 or earlier :

-Xnoagent-Djava.compiler=NONE -Xdebug-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=6006

For JDK 1.4

-Xdebug-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=6006

Fromjava technotes

From 5.0 onwards the -agentlib:jdwp option is used to load and specify options to the JDWP agent. For releases prior to 5.0, the -Xdebug and -Xrunjdwp options are used (the 5.0 implementation also supports the -Xdebug and -Xrunjdwp options but the newer -agentlib:jdwp option is preferable as the JDWP agent in 5.0 uses the JVM TI interface to the VM rather than the older JVMDI interface)

One more thing to note, fromJVM Tool interface documentation:

JVM TI was introduced at JDK 5.0. JVM TI replaces the Java Virtual Machine Profiler Interface (JVMPI) and the Java Virtual Machine Debug Interface (JVMDI) which, as of JDK 6, are no longer provided.

WebLogic

export debugFlag=true

export DEBUG_PORT=7878

set | grep -i debug

./startWebLogic.sh

DEBUG_PORT指定端口

Glassfish

asadmin start-domain --debug [domain-name]

默认监听端口9009

Enabling Debugging

When you enable debugging, you enable both local and remote debugging. To start the server in debug mode, use the----debugoption as follows:

asadmin start-domain --debug [domain-name]

You can then attach to the server from the Java Debugger (jdb) at its default Java Platform Debugger Architecture (JPDA) port, which is 9009. For example, for UNIX systems:

jdb -attach 9009

For Windows:

jdb -connect com.sun.jdi.SocketAttach:port=9009

For more information about thejdbdebugger, see the following links:

Java Platform Debugger Architecture - The Java Debugger:http://java.sun.com/javase/technologies/core/toolsapis/jpda/

Java Platform Debugger Architecture - Connecting with JDB:http://java.sun.com/javase/technologies/core/toolsapis/jpda/

GlassFish Server debugging is based on the JPDA. For more information, seeJPDA Options.

You can attach to the GlassFish Server using any JPDA compliant debugger, including that ofNetBeans, Java Studio Enterprise, JBuilder, Eclipse, and so on.

You can enable debugging even when the GlassFish Server is started without the----debugoption. This is useful if you start the GlassFish Server from the Windows Start Menu, or if you want to make sure that debugging is always turned on.

To Set the Server to Automatically Start Up in Debug Mode

Use the Administration Console. Select the JVM Settings component under the relevant configuration.

Check the Debug Enabled box.

To specify a different port (from 9009, the default) to use when attaching the JVM software to a debugger, specifyaddress=port-numberin the Debug Options field.

To add JPDA options, add any desired JPDA debugging options in Debug Options. SeeJPDA Options.

See Also

For details, click the Help button in the Administration Console from the JVM Settings page.

IDE设置

intellij

intellij使用默认remote设置即可,仅需要更改端口号

Java Tomcat Glassfish Weblogic远程debug(remote debug)的更多相关文章

  1. paip. java resin 远程 调试 java resin remote debug

    paip. java resin 远程 调试 java resin remote debug 作者Attilax  艾龙,  EMAIL:1466519819@qq.com 来源:attilax的专栏 ...

  2. Tomcat Remote Debug操作和原理

    操作篇 这部分主要讲,如何开启tomcat远程调试,并佐以实例.本文方式适用于windows和linux. 假设有两台机器,A是tomcat服务器所在机器,B是IDE安装机器.A和B可以是同一台机器, ...

  3. IntelliJ IDEA远程调试(Debug)Tomcat

    为什么需要这么做? 解决 在我本地是好的啊 这个世界性难题- 测试环境碰到问题,直接连上debug,不用再测试本地,再查看测试环境日志 遇到一些诡异的问题,日志是看不出端倪的 调试一些只能在测试环境执 ...

  4. Java:Remote Debug

    Java  Remote Debug -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,add ...

  5. 排障利器之远程调试与监控 --jmx & remote debug

    监控和调试功能是应用必备的属性之一,其手段也是多种多样. 一般地,我们可以通过:线上日志, zabbix, grafana, cat 等待系统做一问题留底,有问题及时报警,从而达到监控效果. 而对于应 ...

  6. [Reomting Debug] 巧用VS 的remote debug 功能远程调试程序 经验分享.

    前言: 有时候我们Dev(开发人员)需要debug tester(测试人员)或者customer(客户)的环境,可tester的机器上没有Code,是不是有点着急? 而且是多版本应用且tester 发 ...

  7. VS 开发工具中的Remote Debug 功能远程调试程序经验分享

    前言: 有时候我们Dev(开发人员)需要debug tester(测试人员)或者customer(客户)的环境,可tester的机器上没有Code,是不是有点着急? 而且是多版本应用且tester 发 ...

  8. Tomcat、Weblogic、JBoss、GlassFish、Resin、Websphere弱口令及拿webshell方法总结 [复制链接]

    1.java应用服务器    Java应用服务器主要为应用程序提供运行环境,为组件提供服务.Java 的应用服务器很多,从功能上分为两类:JSP 服务器和 Java EE 服务器.1.1  常见的Se ...

  9. remote debug 的详细配置

    一.remote debug 的简单介绍 何为远程debug,项目写完后就需要进入到测试环节,将代码打包发布到测试环境(服务器)上.这时候测试人员测试出一个缺陷(bug).由于代码已经发布到测试环境, ...

随机推荐

  1. 有一种设计风格叫RESTful

    一 前言 刚看了<RESTful Web APIs中文版>.试读了前两章. 每本书的第一章都是抽象得不得了,是整本书的总结:开篇说基础有点简单,从教你怎么向地址栏输入地址訪问网页開始(某人 ...

  2. 安装Discuz!论坛时提示“mysqli_connect() 不支持 advice_mysqli_connect”

    安装Discuz!论坛时提示“不支持Mysql数据库,无法安装论坛”的解决方法1,在系统的 system32(C:\windows\system32)目录下缺少libmysql.dll文件,解决方法是 ...

  3. zoj 1067

    输入一组RGB颜色列表,每行一个颜色,是三个从0~255的整数 前16行是目标颜色组,-1 -1 -1表示结束   16组颜色以后接下来的几行是需要判断的,看它和哪个颜色的距离D最小,找出这个对应的颜 ...

  4. *++p和*p++的区别

    *p++:先是用*p这个值,然后再使p的地址加1. #include<iostream>using namespace std;int main(){    char s[81]=&quo ...

  5. ASP.Net引用类库出现问题 二

    一:引用mysql.data.dll出现,问题? error: Package MySql.Data (.NETCoreApp,Version=v1.). Package MySql.Data sup ...

  6. linux 生产环境搭建

    Linux基础命令杂记   今天又一次搞Linux生产环境搭建.这是种步骤很多,很繁琐而且又不得不做的事情.虽然做过很多次,但还是有很多步骤.命令不记得,每一次到处找资料很麻烦,于是将一些步骤记下,以 ...

  7. Deepin 15.3 下罗技蓝牙键盘连接

    Deepin 15.3中,由于罗技蓝牙键盘需要配对码,所以无法在设置界面连接,本次尝试通过bluetoothctl软件,成功连接,步骤如下: 1.打开系统蓝牙 sudo service bluetoo ...

  8. 利用jQuery打造个性网站

    网页结构 编写全局样式(reset.css) /*全局样式*/ body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fi ...

  9. Realview MDK 中不用手动开中断的原因

    startup.s启动代码文件: ; Enter Supervisor Mode and set its Stack Pointer MSR CPSR_c, #Mode_SVC:OR:I_Bit:OR ...

  10. docker 导入下载模板

    <pre name="code" class="ruby">docker:/root# cat centos-6-x86.tar.gz | dock ...