[转]Remote Debugging with Eclipse + WebSphere 7

原文链接:http://www.mkyong.com/websphere/remote-debugging-with-eclipse-websphere-7

 

So far, there is still lack of WebSphere 7 plugin for both Eclipse and NetBeans IDE. However, you are able to debug your web application via Java Debugger (jdb).

Here’s a guide to show you how to remote debugging your web application in Eclipse and WebSphere via Java Debugger (jdb).

 

Eclipse <----> Java Debugger (jdb) <----> WebSphere 7
1. Enable WebSphere in Debug Mode

In WebSphere web console, left navigation, <script type="text/javascript"></script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script><script src="http://pagead2.googlesyndication.com/pagead/js/r20110324/r20110321-2/show_ads_impl.js"></script><script></script>

1. Servers –> Server Types –> WebSphere application servers
2. Under Server Infrastructure section –> expand Java and Process Management –> Process definition
3. Under Additional Properties section –> click Java Virtual Machine
4. Checked the “Debug Mode
5. In Debug arguments textbox, put this

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

6. Restart WebSphere server instance.

debug-eclipse-websphere

Now, WebSphere is started in debug mode, and listening on port 8888. (Later, Eclipse will connect to this port for debugging)

 

2. Install or deploy web application to WebSphere

“war” your web application, install (first-time) or deploy it to WebSphere. And start your web application in WebSphere.

 

3. Eclipse’s Java Debugger (jdb)

In Eclipse IDE, under your project source

1. Click on “Run”, “Debug Configurations…”
2. Select “Remote Java Application”, right click and select “New”
3. Renamed a new name , e.g “WebSphere 7 Instance”
4. In “Connection Type”, select default, “Standard (Socket Attached)
5. Host, put your WebSphere host IP
6. Port, put 8888.

debug-eclipse-websphere

7. Click on the debug button.

Now, Eclipse debugger is started and connected to port 8888.

 

4. Debugging, see result!

Open your favor browser, and type your web application URL. Now, Eclipse will stop at your predefined breakpoint.

debug-eclipse-websphere

Done.

 

Note
This Java Debugger (jdb) solution is able to apply on most of the Java Application Servers, like JBoss, WebLogic, or even in Servlet Container like Tomcat. The only problem in this method is, you have to make sure the deployed web application is synchronize with Eclipse’s debugging source code.
References
  1. http://www.eclipsezone.com/eclipse/forums/t53459.html
  2. http://www.jacoozi.com/index.php?option=com_content&task=view&id=119&Itemid=134
  3. http://websphere.sys-con.com/node/43391
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值