Java Tomcat Glassfish Weblogic远程debug(remote debug)
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)的更多相关文章
- paip. java resin 远程 调试 java resin remote debug
paip. java resin 远程 调试 java resin remote debug 作者Attilax 艾龙, EMAIL:1466519819@qq.com 来源:attilax的专栏 ...
- Tomcat Remote Debug操作和原理
操作篇 这部分主要讲,如何开启tomcat远程调试,并佐以实例.本文方式适用于windows和linux. 假设有两台机器,A是tomcat服务器所在机器,B是IDE安装机器.A和B可以是同一台机器, ...
- IntelliJ IDEA远程调试(Debug)Tomcat
为什么需要这么做? 解决 在我本地是好的啊 这个世界性难题- 测试环境碰到问题,直接连上debug,不用再测试本地,再查看测试环境日志 遇到一些诡异的问题,日志是看不出端倪的 调试一些只能在测试环境执 ...
- Java:Remote Debug
Java Remote Debug -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,add ...
- 排障利器之远程调试与监控 --jmx & remote debug
监控和调试功能是应用必备的属性之一,其手段也是多种多样. 一般地,我们可以通过:线上日志, zabbix, grafana, cat 等待系统做一问题留底,有问题及时报警,从而达到监控效果. 而对于应 ...
- [Reomting Debug] 巧用VS 的remote debug 功能远程调试程序 经验分享.
前言: 有时候我们Dev(开发人员)需要debug tester(测试人员)或者customer(客户)的环境,可tester的机器上没有Code,是不是有点着急? 而且是多版本应用且tester 发 ...
- VS 开发工具中的Remote Debug 功能远程调试程序经验分享
前言: 有时候我们Dev(开发人员)需要debug tester(测试人员)或者customer(客户)的环境,可tester的机器上没有Code,是不是有点着急? 而且是多版本应用且tester 发 ...
- Tomcat、Weblogic、JBoss、GlassFish、Resin、Websphere弱口令及拿webshell方法总结 [复制链接]
1.java应用服务器 Java应用服务器主要为应用程序提供运行环境,为组件提供服务.Java 的应用服务器很多,从功能上分为两类:JSP 服务器和 Java EE 服务器.1.1 常见的Se ...
- remote debug 的详细配置
一.remote debug 的简单介绍 何为远程debug,项目写完后就需要进入到测试环节,将代码打包发布到测试环境(服务器)上.这时候测试人员测试出一个缺陷(bug).由于代码已经发布到测试环境, ...
随机推荐
- http头部信息研究
1. Accept:告诉WEB服务器自己接受什么介质类型,*/* 表示任何类型,type/* 表示该类型下的所有子类型,type/sub-type. 2. Accept-Charset: 浏览器申明自 ...
- php之Cookie与Session详解
Cookie管理 Cookie是在HTTP协议下,通过服务器或脚本语言可以维护客户浏览器上信息的一种方式,Cookie的使用很普遍,许多提供个人化服务的网站都是利用Cookie来区别不同用户,以显示与 ...
- sql显示12个月数据
需求 最近在做一个财务报表展示系统,Budget需要当月上传,还未上传月份的数据也需要显示出来. 数据库设计 cBudget表结构如下 CREATE TABLE [dbo].[cBudget]( ,) ...
- 随机抽样一致性算法(RANSAC)
本文翻译自维基百科,英文原文地址是:http://en.wikipedia.org/wiki/ransac,如果您英语不错,建议您直接查看原文. RANSAC是"RANdom SAmple ...
- winform使用xml作为数据源
1.新建窗体应用程序 2.拖放DataGridView 3.在bin\Debug中放入XML文件 using System; using System.Collections.Generic; usi ...
- const与重载
转载自CSDN博客:http://blog.csdn.net/polarbearboy/article/details/6762752 (由于该作者也属于转载,不知原出处) PS:我们很易对下面这 ...
- Lucene学习之初步了解
全文搜索 比如,我们一个文件夹中,或者一个磁盘中有很多的文件,记事本.world.Excel.pdf,我们想根据其中的关键词搜索包含的文件.例如,我们输入Lucene,所有内容含有Lucene的文件就 ...
- JS判断是否在微信浏览器打开
if (browser.versions.mobile) {//判断是否是移动设备打开.browser代码在下面 var ua = navigator.userAgent.toLowerCase(); ...
- jupyter巨好玩-常用设置
整理一下有用的设置: 自定义ipython工作目录 用jupyter notebook默认打开的页面时,默认在的是home路径,会看见一大堆东西,假如我们只想展示jupyter的工程目录咋办? 简单说 ...
- 论山寨手机与Android联姻 【9】SmartPhone的硬件结构
如何区别智能手机(SmartPhone)与功能手机(FeaturePhone)? 有一种观点认为,智能手机本质上是功能手机与便携式电脑(Laptop PC)的结合.功能手机的功能受限于制造厂商的预制, ...