- 浏览: 1230748 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (718)
- HTML (13)
- JS基础 (23)
- JS应用 (40)
- AJAX (6)
- JSP相关 (12)
- JAVA基础 (52)
- JAVA应用 (74)
- APPLET (11)
- SWING\RCP (2)
- JAVA反射 (6)
- 设计模式 (26)
- 数据库设计 (20)
- Struts (35)
- Struts2 (12)
- Spring (22)
- Hibernate (45)
- Ibatis (18)
- mybatis (3)
- SSH (8)
- UML (5)
- WebService (3)
- XML (16)
- Log4j (7)
- WEB容器 (26)
- 数据结构 (36)
- Linux (34)
- Ruby on Rails (1)
- 其它技术 (27)
- IDE配置 (15)
- 项目实战 (2)
- Oracle (69)
- JAVA报表 (7)
- Android学习 (2)
- 博客链接 (1)
- 网络基础 (1)
- WEB集群 (1)
- .Net开发 (11)
- PB (4)
- 系统构建 (15)
最新评论
-
jnjeC:
牛逼啊哥们,讲得太好了
Maven仓库理解、如何引入本地包、Maven多种方式打可执行jar包 -
九尾狐的yi巴:
很好 感谢!
Itext中文处理(更新版) -
luweifeng1983:
有用的,重启一下嘛。
设置eclipse外部修改文件后自动刷新 -
Master-Gao:
设置了也不管用,怎么破呢?
设置eclipse外部修改文件后自动刷新 -
aigo_h:
锋子还有时间写博客,还是很闲哈!
Add directory entries问题
- remsetJAVA_OPTS=-Xdebug-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y%JAVA_OPTS%
rem set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%
将该注释去掉(即去掉rem),重新用run.bat启动JBoss即可。
Linux环境:
找到Linux环境下的JBoss启动文件:run.sh
为了保留以前的启动配置,我们作以下操作:
# cp run.conf run-debug.conf
# vi run-debug.sh
查找run.conf,改为run-debug.conf,然后保存run-debug.sh文件
查找8787,可以找到:
- #JAVA_OPTS="$JAVA_OPTS-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
把注释去掉
重新启动JBoss即可
启动之后,JBoss服务器会在8787端口进行侦听。
如果使用Eclipse作为IDE开发环境,可以这样设置:
按照画面所示设置好跟JBoss服务器的连接之后,便可在程序中设置断点,执行画面处理,便会在断点出停住调试了。
Remote Debugging with Eclipse
At 8:22 PM on Nov 1, 2005, Levent Gurses wrote:
How many times trying to fix a server-side Java problem appeared trivial, but getting to the source of the problem took all the time? A remote debugger attached to a Java application can shorten the defect-discovery times significantly and make the process more enjoyable.
The Java Debugger
The Java Debugger (jdb) is a dynamic, controlled, assignment-based debugging tool. It helps find and fix bugs in the Java language programs both locally and on the server. To use jdb in a J2EE application server you must first launch it with debugging enabled and attach to the server from the debugger through a JPDA port (Default port is 1044).
The default JPDA options for J2EE servers are as follows:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044
The jdb parameters specify the way debugger will operate. For instance transport=dt_socket instructs the JVM that the debugger connections will be made through a socket while the address=1044 parameter informs it that the port number will be 1044. Similarly, if you substitute suspend=y , the JVM starts in suspended mode and stays suspended until a debugger is attached to it. This may be helpful if you want to start debugging as soon as the JVM starts.
Debugging WebLogic
Debugging WebLogic is no different than debugging any other Java remote application. You need to make sure to launch it with the required debugging arguments and attach a debugger. In the case of WebLogic 8.1, you need to add these arguments to the startup script. WebLogic comes with several launch scripts (*.sh and *.cmd) under BEA_HOME/weblogic81/server/bin.
- Locate startWSL.cmd and add the following variable DEBUG_OPTS:
set DEBUG_OPTS = -Xdebug -Xrunjdwp:transport= dt_socket,address=1044,server=y,suspend=n
- 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% -Dweblogic.management.username= %WLS_USER%-Dweblogic.management.password= %WLS_PW% -Dweblogic.management.server= %ADMIN_URL%-Dweblogic.ProductionModeEnabled= %PRODUCTION_MODE%-Djava.security.policy= "%WL_HOME%\server\lib\weblogic.policy" weblogic.Server
Debugging JBoss
Same as WebLogic, except that you need to change run.bat/run.sh located under JBOSS_HOME/bin.
Linux users should see something similar to this:
$ cd /var/jboss4/bin $ sh ./run.sh ========================================================================= JBoss Bootstrap Environment JBOSS_HOME: /var/jboss4 JAVA: /usr/java/j2sdk1.4.2_06/bin/java JAVA_OPTS: -server -Xms128m -Xmx128m -Dprogram.name=run.sh DEBUG_OPTS = -Xdebug -Xrunjdwp:transport= dt_socket,address=1044,server=y,suspend=n CLASSPATH: /var/jboss4/bin/run.jar:/usr/java/j2sdk1.4.2_06/lib/tools.jar =========================================================================
Debugging Tomcat
Again, very much similar to WebLogic and JBoss, except that you need to change catalina.bat/catalina.sh located under TOMCAT_HOME/bin.
Debugger Verification
Now you can launch your application in debug mode. Just to make sure that the server is listening to port 1044 you can run netstat /a. You should see port 1044 in the list of open ports (See Figure 1: List of open ports: netstat -a).
Figure 1 List of open ports: netstat -a
The Eclipse Connection
After making sure WebLogic is listening for incoming connections on port 1044, what is left is to tell Eclipse to connect to this port and you are ready to debug.
- In Eclipse, navigate to Run | Debug (See Figure 2: Create new Remote Java Application configuration in Eclipse ).
- Select Remote Java Application , on the left column. Click New , on the bottom of the same column.
- In the Create configuration screen you'll be prompted to enter some values. Start with a meaningful name. In my case that's WebLogic Instance . For Project, select the Java project that contains the source code you want to debug. Leave Connection Type in default, i.e. Standard (Socket Attach) . For Host , enter localhost. If you want to debug a remote server, enter its hostname or IP address. For port, enter 1044 or the port you defined in your WebLogic startup script.
- Click Apply
- Make sure WebLogic instance is running in debug mode. In the same screen click Debug . Eclipse should automatically take you to the Debug perspective and you should see a stack trace in the Debug view.
- If you are not automatically taken to the Debug perspective, select Window | Open Perspective | Other and then click Debug.
Figure 2 Create new Remote Java Application configuration in Eclipse
<span http://
Eclipse Debug window should automatically pop-up with the stack pointer on your first breakpoint (See Figure 3: Breakpoint hit in Eclipse's debugger ). After that, you can use all the various functions that the debugger has to offer, namely variable assignments, step-into, drop to frame, etc.
Figure 3 Breakpoint hit in Eclipse debugger
附件里面分别为两个不同版本JBOSS的远程调试设置文件run.bat
- jboss3.2.0_remote_debug_run.rar (1.1 KB)
- 下载次数: 1
- jboss4.2.3_remote_debug_run.rar (1.5 KB)
- 下载次数: 1
发表评论
-
MyEclipse8.5支持Tomcat7.0
2016-03-08 10:07 742MyEclipse8.5 项目编译环境只能到1.6,没关 ... -
tomcat的URIEncoding的作用
2012-02-10 10:59 1132tomcat5中,为了保证get数据采用UTF8编码,在ser ... -
解决tomcat8080端口常被莫名占用问题
2011-09-27 13:02 888http://topic.csdn.net/u/2010030 ... -
tomcat各配置文件详解
2011-07-09 13:20 1132tomcat各文件夹作用: http://hi.bai ... -
如何在service.xml中配置Oralce连接池
2010-11-03 13:18 926http://blog.163.com/ryan_lz/blo ... -
Tomcat升级到6.0遇到的双引号改单引号问题
2010-08-18 09:08 2459在如下调用时出错: <jsp:include p ... -
TomCat下连接池的创建及部署For DB2 ,ORACLE
2010-08-05 15:21 1663一.Tomcat 下部署DB2连接池 将db2安装目录C:\ ... -
在Tomcat和Eclipse进行远程调试的配置
2010-01-18 12:21 2555引自:http://avar.iteye.com/bl ... -
Tomcat端口占用解决办法及连接到localhost 提示:位于 XDB 的服务器 localhost 要求用户名和密码
2008-04-16 23:11 1583TOMCAT运行提示如下错误: 2008-4-1622: ... -
JAVA学习提高之----Tomcat的静态和动态部署
2008-12-23 16:14 991在Tomcat中部署Java Web应用程序有两种方式:静态部 ... -
JAVA学习提高之----MyEclipse下配置Tomcat过程
2008-12-23 16:27 1131这么些天没有写java了,手有点生疏,重新安装计算机后,配置方 ... -
JAVA学习提高之----如何用Eclipse和Tomcat Plugin来建立一个开发环境(个人实践)
2008-12-23 17:40 1062在我的“WEB服务器”类别的博客中分别介绍了Tomcat的配置 ... -
JAVA基础学习篇----Eclipse进行(JBOSS)远程调试
2009-01-12 14:20 1704原文如下:http://java.chinaitlab.com ... -
JAVA学习提高之---- JBOSS下配置数据源
2009-02-10 17:54 811引用 : http://java.ccidnet.com/a ... -
JBOSS版本:4.2.2GA 无法通过IP访问,或只能通过127.0.0.1访问的问题解决
2009-02-17 11:08 1305http://feng88724.iteye.com/blog ... -
JBoss 5.0 安装与配置详解
2009-02-24 13:24 1023本文引自:http://blog.csdn.net/allen ... -
关于Jboss版本的问题!
2009-07-28 15:43 1534http://zidane1983.iteye.com/blo ... -
weblogic 配置大全
2009-09-09 16:07 839Weblogic配置大全 用Eclipse MyEclip ... -
Remote Debugging with Eclipse 各种web服务器的远程调试设置
2009-09-10 15:25 1433JPDA DOCUMENT: http://java.sun ... -
JAVA调试JPDA
2009-09-10 16:26 1093http://java.sun.com/j2se/1.4.2/ ...
相关推荐
在IT行业中,远程调试是一种非常重要的技能,它允许开发者在本地环境中对运行在远程服务器上的应用程序进行调试,极大地提高了开发效率。本篇将详细介绍如何在MyEclipse中远程调试JBoss AS7或JBoss EAP6,无论是在...
### JBoss远程调试配置详解 #### 一、引言 JBoss AS(Application Server)是Red Hat提供的一个开源Java应用服务器,广泛应用于企业级应用程序的开发与部署。在实际开发过程中,为了更高效地定位问题并解决问题,...
### Eclipse与JBoss远程调试详解 #### 一、引言 在软件开发过程中,经常会遇到部署在测试或生产环境的应用出现问题但无法在本地环境中重现的情况。这种情况下,使用远程调试技术能够有效地帮助开发者定位问题所在...
在实际应用中,`jbossc-common-client.jar`常被添加到项目的类路径中,以便客户端程序能够访问和操作远程JBoss服务器上的服务。同时,`jboss-LICENSE.txt`文件是JBoss开源许可证的文本,规定了软件的使用、分发和...
jbos-jaxrpc.jar 文件是JBoss对Java API for XML-RPC(Java JAX-RPC)的实现,它允许Java应用程序通过SOAP调用远程过程。JAX-RPC使得开发人员可以轻松地创建和使用Web服务,而不必关心底层的网络细节。 twiddle.jar...
JBoss-4.2.3.GA-jdk6.zip 是一个包含了JBoss应用服务器的版本4.2.3 GA(General Availability),专为Java Development Kit(JDK)6设计的软件包。JBoss是一个开源的企业级Java应用服务器,它遵循Java EE...
这个库允许开发者将日志信息输出到不同的目的地,如控制台、文件或远程服务器,并且可以与其他日志系统(如Log4j或Java Util Logging)集成。 **Validation API**,即`validation-api-1.0.0.GA.jar`,是Java Bean ...
- **调试工具**:可以使用IDE(如Eclipse)的插件进行远程调试,或者直接在命令行下使用JMX控制台进行管理。 **6. 扩展性** - **模块化设计**:允许添加自定义模块,扩展功能。 - **连接器支持**:如Tomcat ...
JBoss AS 7.1.1.Final 是一个企业级的应用服务器,它是Red Hat JBoss 产品线的一部分,主要用于部署和管理Java EE(Java Platform, Enterprise Edition)应用程序。这个版本在2012年发布,是JBoss AS 7系列的一个...
- **开发环境**:开发者可以利用 JBoss 5.0 快速搭建测试环境,调试和测试 Java EE 应用。 - **生产环境**:企业可以部署关键业务应用,利用其高可用性和可扩展性来满足大规模需求。 - **集成测试**:通过 JBoss ...
【JBoss 4.2.2】是Java企业版服务器(Java Enterprise Edition,简称JEE)的一个重要版本,由Red Hat公司开发。这个版本在2007年发布,为开发者提供了全面的中间件服务,支持多种JEE规范,如Java Servlet、JSP、EJB...
- **调试技巧**:学习如何在Eclipse中使用调试功能,定位和修复代码中的错误。 - **性能优化**:通过调整配置、优化代码和利用缓存等手段,提升应用的运行效率。 ### 八、后续步骤 - **XML配置**:了解如何使用XML...
10. **热部署**:JBoss AS支持热部署,可以在不重启服务器的情况下更新应用,提高了开发和调试效率。 在解压"jboss-5.0.1.GA.zip"后,你会得到一个包含多个目录和文件的结构,如`bin`、`server`、`deploy`等,这些...
【JBoss7学习笔记】 JBoss Application Server,简称JBoss AS,是Red Hat公司开发的一款开源Java EE应用服务器,而JBoss7则是其一个重要的版本,带来了许多性能优化和架构改进。这篇学习笔记将深入探讨JBoss7的核心...
通过深入学习这些源代码,开发者可以提升对Java企业级开发的理解,掌握服务器端架构设计、性能优化、分布式通信等方面的知识,为开发高可用、高性能的Java应用打下坚实基础。同时,理解源码也有助于自定义配置和扩展...
在实际应用中,Apache Tomcat可以配置为独立服务器,也可以与更全面的Java EE应用服务器如Apache TomEE或JBoss等结合使用。Tomcat支持多线程处理,可以同时处理多个客户端请求,通过端口(默认为8080)监听网络连接...