Eclipse裸奔调试WebLogic

项目开发的时候能做断点就最好啦~而eclipse在这点上是比不上myeclipse的
那么是不是说我们就不能断点了呢?现在的项目里同事用到了断点我就理所当然也要用啦`在设置的过程中发现一些问题记录下来!

步骤:
1. 用编译器打开weblogic项目目录下的startWebLogic.cmd ,在里面加上这句:
set JAVA_OPTIONS=%JAVA_OPTIONS% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n

2.在eclipse里面
项目名上右键-DeBug As-DeBug configurations...-选择Remote Java Application下你的项目-设置connect Properties下为: localhost 8888,这个port对应的是上面的address.

3.启动服务器,在项目名上右键Debug As-DeBug configurations...-点击DeBug按钮!
然后理论上是可以断点的了!

PS:可是我这里报错:
"Unable to install breakpoint due to missing line number attributes,Modify compiler options to generate line number attributes"

遇到这个错误时找到的解答方案汇总:
1、使用Ant编译时,未打开debug开关,在写javac 任务时确认debug=true,否则不能调试。THe settings for the eclipse compiler don't affect the ant build and even if you launch the ant build from within eclipse. ant controls it's own compiler settings.you can tell ant to generate debugging info like this 'javac ... debug="true".../>
2、编译器的设置问题,window->preferences->java->Compiler在compiler起始页,classfile Generation区域中确认已经勾选了All line number attributes to generated class files。如果已经勾选,从新来一下再Apply一下。或者从项目层次进行设定,项目属性->java compiler同样在起始页,确定已经勾选
Eclipse报的这个错,无非就这两个原因造成的

第一点是eclipse默认的,不需要怎么改!第二点就是ant部署的时候编译java文件没有debug="true"的属性!
加上后重新编译部署启动服务器,点击debug,运行项目,就可以正常断点调试了!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值