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).由于代码已经发布到测试环境, ...
随机推荐
- ASP.NET State Service
本文来自:http://www.cnblogs.com/jhxk/articles/1648194.html 这一段就是配置应用程序是如何存储Session信息的了.我们以下的各种操作主要是针对这一段 ...
- SQLServer中临时表与表变量的区别分析【转】
在实际使用的时候,我们如何灵活的在存储过程中运用它们,虽然它们实现的功能基本上是一样的,可如何在一个存储过程中有时候去使用临时表而不使用表变量,有时候去使用表变量而不使用临时表呢? 临时表 临时表与永 ...
- [每日一题] 11gOCP 1z0-052 :2013-09-19 创建用户...................................................B41
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/11834661 正确答案:BC 这道题比较简单,我就以答案来解析,如下来自官方文档创建用户的 ...
- hdu 4753 Fishhead’s Little Game
状态压缩dp解博弈问题(记忆化搜索).比赛的时候最后才开始做这道题,而且当时不知道为什么一直犯一些很2B的问题,导致没能ac,晚上看了看原先的代码,改了一下就MLE了...我原先是开的dp[1 < ...
- docker相关配置
一.概述: 1.centos7下,默认firewalld为防火墙, systemctl status firewalld.service 2.关闭firewalld, systemctl stop f ...
- springmvc 传递和接收数组参数
java url中如何传递数组,springMVC框架controller类如何接收数组参数? 下面介绍一下URL中传递数组参数方法: dd.do?titles[]=col1&titles[] ...
- JAVA 和 C# 调用外部.exe文件,传值并等等exe完成,获取返回值
JAVA- String ykexe = getProperty("ykexe") + " " + tableout; //getproperty(" ...
- IBATIS处理typeHandler类容易范的SQLException总结
1. java.sql.SQLException: 无效的列类型 原因: A. ibatis的IN,OUT参数.或者typeHandler类中传入的参数值数据类型与Oracle自定义对象中的属性值的数 ...
- 如果有需要确解MD5的,可以尝试这个网站。
http://www.hashkiller.co.uk/md5-decrypter.aspx
- 数组转DataTable
using System; using System.Data; namespace ArrayToDataTable { class ArrayToDataTable { /// <summa ...