设置调试linux下jdb远程调试tomcat源码

系统 2277 0

时间紧张,先记一笔,后续优化与完善。

    在tomcat打开调试设置jvm参数

    

    -Xrunjdwp:transport=dt_socket,server=y,address=9090,suspend=y

    

    在linux命令行jdb连接9090端口

    

    jdb -attach ip:9090 -sourcepath /softwares/apache-tomcat-7.0.40-src/java

    

    设置断点

    

    stop at org.apache.tomcat.util.IntrospectionUtils:402 stop at org.apache.tomcat.util.IntrospectionUtils:406 stop at org.apache.tomcat.util.IntrospectionUtils:408 stop at org.apache.tomcat.util.IntrospectionUtils:412

    

    执行程序

    

    main[1] run > Set deferred breakpoint org.apache.tomcat.util.IntrospectionUtils:412 Set deferred breakpoint org.apache.tomcat.util.IntrospectionUtils:412 Set deferred breakpoint org.apache.tomcat.util.IntrospectionUtils:408 Unable to set deferred breakpoint org.apache.tomcat.util.IntrospectionUtils:406 : No code at line 406 in org.apache.tomcat.util.IntrospectionUtils Stopping due to deferred breakpoint errors. Set deferred breakpoint org.apache.tomcat.util.IntrospectionUtils:402 Breakpoint hit: Breakpoint hit: "thread=main", org.apache.tomcat.util.IntrospectionUtils.setProperty(), line=412 bci=849 412 ExceptionUtils.handleThrowable(ie.getCause());

    每日一道理
虽然你现在还只是一株稚嫩的幼苗。然而只要坚韧不拔,终会成为参天大树;虽然你现在只是涓涓细流,然而只要锲而不舍,终会拥抱大海;虽然你现在只是一只雏鹰,然而只要心存高远,跌几个跟头之后,终会占有蓝天。

    

    打印变量

    

    main[1] locals Method arguments: o = instance of x.x.x.JNDIRealm(id=1156) name = "connectionPassword" value = "1234" invokeSetProperty = true Local variables: setter = "setConnectionPassword" ie = instance of java.lang.reflect.InvocationTargetException(id=1160) main[1] dump ie.target ie.target = { serialVersionUID: -7034897190745766939 java.lang.Exception.serialVersionUID: -3387516993124229948 java.lang.Throwable.serialVersionUID: -3042686055658047285 java.lang.Throwable.detailMessage: "password decrypt is error!" java.lang.Throwable.cause: instance of java.lang.RuntimeException(id=1163) java.lang.Throwable.stackTrace: null }

    

    打印变量dump信息

    

    main[1] dump ie.target.cause ie.target.cause = { serialVersionUID: -7034897190745766939 java.lang.Exception.serialVersionUID: -3387516993124229948 java.lang.Throwable.serialVersionUID: -3042686055658047285 java.lang.Throwable.detailMessage: "get content from cyberark error" java.lang.Throwable.cause: instance of javapasswordsdk.exceptions.PSDKException(id=1165) java.lang.Throwable.stackTrace: null }

    

    ctrl+c 退出

    

    main[1]

    

文章结束给大家分享下程序员的一些笑话语录: 现在社会太数字化了,所以最好是有一个集很多功能于一身的设备!

设置调试linux下jdb远程调试tomcat源码


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论