Arthas利用Spring容器获取对象 调用实例方法 线上问题排查Tips

启动arthas

java -jar arthas-boot.jar

启动Arthas

记录RequestMappingHandlerAdapter#invokeHandlerMethod的请求,获取index

tt -t org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter invokeHandlerMethod

invokeHandlerMethod请求index

获取SpringContext

tt -i 第二步的index -w '
#ac=target.getApplicationContext()
'

此处''中的语法为OGNL,详细指南:http://commons.apache.org/proper/commons-ognl/language-guide.html

通过SpringContext获取Spring容器中任意一个Component

tt -i 第二步的index -w '
#ac=target.getApplicationContext(),
#orderDomainService=#ac.getBean("orderDomainServiceImpl"),
#subOrderEntityRepository=#ac.getBean("subOrderEntityRepository"),
#order=#orderDomainService.doMethod("指定子订单号"),
#subOrderEntity=#order.getSubOrderEntityList().get(0),
#requestJson=@com.poizon.fusion.utils.JsonUtils@serialize(#subOrderEntity)'

运行结果:

{
    "id":410,
    "orderNo":"510100016560346748",
    "subOrderNo":"110100016560356748",
    "bizType":"CONSIGN",
    "bizCode":"duapp.general",
    "bizChannel":"",
    "bizId":"",
    "status":"TRADE_SUCCESS",
    "buyerInfo":{
        "userId":45816748,
        "userName":"慈祥喷泡zFJ"
    },
    "sellerInfo":{
        "userId":10029,
        "userName":"我手机三脚架"
    },
    "productPrice":13900,
    "freightPrice":1400,
    "payAmount":15300,
    "discountAmount":0,
    "depositAmount":2800,
    "poundageAmount":3648,
    "count":1,
    "freightInfo":{
        "freight":1400,
        "freightGray":false
    },
    "buyerLogisticEntity":{
        "id":431,
        "logisticNo":"EX1010007132106748",
        "logisticStage":3,
        "orderNo":"510100016560346748",
        "subOrderNo":"110100016560356748",
        "buyerId":45816748,
        "expressType":"SF",
        "expressNo":"SF773278234517",
        "expressStatus":20,
        "senderAddress":"上海上海市虹口区互联宝地",
        "receiverAddress":"江苏省南京市玄武区互联宝地",
        "senderMobile":"1231232435435",
        "receiverMobile":"17612160914",
        "feature":"{"receiptStatus":true,"signTime":"2021-03-07 10:50:59","sendTime":"2021-02-28 10:50:59"}",
        "logisticFeature":{
            "receiptStatus":true,
            "signTime":"2021-03-07 10:50:59",
            "sendTime":"2021-02-28 10:50:59"
        },
        "createTime":"2021-02-28 10:50:52.000",
        "modifyTime":"2021-03-07 10:50:59.225"
    },
    "inventoryNo":"SN109615732",
    "skuId":324537,
    "buyerNote":"",
    "sellerNote":"",
    "buyerDel":0,
    "subOrderCloseTime":"2021-02-28 10:50:52.611",
    "paidTime":"2021-02-28 10:50:54.485",
    "createTime":"2021-02-28 10:50:52.000",
    "modifyTime":"2021-03-07 10:50:59.212",
    "roundId":0,
    "buyerAddressId":0,
    "discountInfos":[

    ],
    "useRedPacket":false,
    "useAllowance":false,
    "productId":55,
    "productInfo":{
        "skuId":324537,
        "skuPic":"[https://cdn.poizon.com/source-img/origin-img/20201210/105c1de1fec844038f07f42e7eeea50c.jpg](https://cdn.poizon.com/source-img/origin-img/20201210/105c1de1fec844038f07f42e7eeea50c.jpg)",
        "skuCategory":38,
        "skuTitle":"打折Nike Dunk Low Premiun SB QS 北京",
        "spuId":55,
        "spuTitle":"打折Nike Dunk Low Premiun SB QS 北京",
        "skuProp":{
            "6":"35.5"
        },
        "skuTagType":5,
        "signupPrice":0,
        "authPrice":5800,
        "articleNumber":"504750-077",
        "otherNumbers":"",
        "preSellDeliverTime":0,
        "isSelf":0,
        "sellLimitPurchase":0,
        "preSellLimitPurchase":1,
        "level1CategoryId":29,
        "level2CategoryId":35,
        "categoryTag":"{"PAYMENT":["PAYMENT_HUABEI","PAYMENT_HUABEI_STAGING"]}",
        "goodsType":0,
        "brandId":144,
        "relationBrandIds":"",
        "fitId":1,
        "receiveMinTime":2,
        "receiveMaxTime":2,
        "saleAfterFlag":0,
        "unconditionalReturn":0,
        "size":"35.5",
        "self":false
    },
    "sellerAddressInfo":{
        "userId":10029,
        "zipCode":""
    },
    "repositoryAddress":{
        "userAddressId":3,
        "province":"上海",
        "city":"上海市",
        "district":"虹口区",
        "address":"互联宝地",
        "addressDetail":"上海上海市虹口区互联宝地",
        "mobile":"1231232435435",
        "name":"得物白冰冰",
        "warehouseAddressType":"VIRTUAL",
        "zipCode":"",
        "warehouseCode":"SH12",
        "warehouseZoneCode":"YQSH01"
    },
    "buyerAddressInfo":{
        "userAddressId":1010004160,
        "userId":45816748,
        "province":"江苏省",
        "city":"南京市",
        "district":"玄武区",
        "address":"互联宝地",
        "addressDetail":"江苏省南京市玄武区互联宝地",
        "mobile":"17612160914",
        "name":"红包吧v",
        "countryCode":"",
        "modifyTimes":0,
        "zipCode":"",
        "optionalAddress":"",
        "userMobile":"11122221604",
        "hasSelfBuy":false,
        "hasCheck":true,
        "realReceiveSmsMobile":"17612160914"
    },
    "sellerBackAddressInfo":{
        "userAddressId":1010004113,
        "userId":10029,
        "province":"浙江省",
        "city":"杭州市",
        "district":"西湖区",
        "address":"尴尬vv",
        "addressDetail":"浙江省杭州市西湖区尴尬vv",
        "mobile":"15618153285",
        "name":"沟沟壑壑",
        "countryCode":"",
        "modifyTimes":0,
        "zipCode":"",
        "optionalAddress":""
    },
    "poundageInfo":{
        "poundageInfoList":[
            {
                "expenseType":1,
                "expenseName":"技术服务费",
                "originalExpense":209,
                "currentExpense":209,
                "originalPercent":150,
                "currentPercent":150,
                "extendJson":"{"currentPercent":150,"currentexpense":209,"expenseLimit":{"max":24900,"min":0},"originalTechnicalFeeLimit":{"expenseLimit":{"max":24900,"min":0},"originalExpense":209,"originalPercent":150}}"
            },
            {
                "expenseType":3,
                "expenseName":"转账手续费",
                "originalExpense":139,
                "currentExpense":139,
                "originalPercent":100,
                "currentPercent":100,
                "extendJson":"{"currentExpense":139,"currentPercent":100,"originalExpense":139,"originalPercent":100}"
            },
            {
                "expenseType":5,
                "expenseName":"查验费",
                "originalExpense":800,
                "currentExpense":800,
                "extendJson":"{"currentExpense":800,"originalExpense":800}"
            },
            {
                "expenseType":2,
                "expenseName":"鉴别费",
                "originalExpense":1500,
                "currentExpense":1500,
                "extendJson":"{"currentExpense":1500,"originalExpense":1500}"
            },
            {
                "expenseType":4,
                "expenseName":"包装服务费",
                "originalExpense":1000,
                "currentExpense":1000,
                "extendJson":"{"currentExpense":1000,"originalExpense":1000}"
            },
            {
                "expenseType":7,
                "expenseName":"预计收入",
                "originalExpense":10252,
                "currentExpense":10252
            },
            {
                "expenseType":6,
                "expenseName":"总费用",
                "originalExpense":3648,
                "currentExpense":3648
            }
        ],
        "version":"1.0.0",
        "totalAmount":3648,
        "poundageAmount":209
    },
    "inventoryInfo":{
        "saleInventoryNo":"SN109615732",
        "skuId":324537,
        "uid":10029,
        "price":13900,
        "biddingType":5,
        "deposit":2800,
        "prepaidFee":1390,
        "currency":"CNY",
        "countryCode":"CN",
        "deliveryCountryCode":"CN",
        "childSubBiddingType":0,
        "sellerBiddingNo":"102020031000861366",
        "createTime":1614480650,
        "modifyTime":1614480651,
        "deliveryTime":3600,
        "receiveMinTime":2,
        "receiveMaxTime":2,
        "orginInvenNo":"SN109615732",
        "sourceType":"poizon",
        "sourceId":"",
        "warehouseZoneCode":"YQSH01"
    },
    "depositInfo":{
        "prepaidFee":1390,
        "childSubBiddingType":0,
        "applyNo":"AP1010009479911",
        "applyItemNo":"JS002916000007166469",
        "jsType":3
    },
    "preferentialInfo":{
        "buyerShowDiscountList":[

        ],
        "discountList":[

        ],
        "needRecommend":false,
        "freightNeedRecommend":false,
        "oldPreferentialList":[

        ]
    },
    "merchantInfo":{
        "merchantId":318741,
        "typeId":0,
        "userId":10029,
        "username":"翟天凡",
        "realName":"翟天凡",
        "idCardNo":"320*************18",
        "mobile":"11166668888",
        "balanceType":0,
        "isUnconditionalReturn":1,
        "isUnconditionalReturnByMerchant":1,
        "status":1,
        "adminUserId":0,
        "merchantIdCard":"PBDR20081180645956",
        "isInvoice":0,
        "skipCheck":false,
        "poundageDiscount":-2
    },
    "downPaymentInfo":{
        "promotionNo":"-1",
        "skipCheck":false
    },
    "qualityEntity":{
        "id":287,
        "orderNo":"510100016560346748",
        "subOrderNo":"110100016560356748",
        "buyerId":45816748,
        "spuId":324537,
        "skuId":324537,
        "qcId":0,
        "qcResultType":0,
        "qcResultDesc":"质检通过",
        "qcResultPics":"",
        "confirmStatus":0,
        "createTime":"2021-02-28 10:50:52.000",
        "modifyTime":"2021-02-28 10:50:52.000",
        "qualityPassedTime":"2021-02-28 10:50:59.000",
        "qualityBeginTime":"2021-02-28 10:50:52.621",
        "feature":"{}",
        "qualityFeature":{

        }
    },
    "identifyEntity":{
        "id":287,
        "orderNo":"510100016560346748",
        "subOrderNo":"110100016560356748",
        "spuId":324537,
        "skuId":324537,
        "buyerId":45816748,
        "identifyId":0,
        "identifyResultType":1,
        "identifyResultDesc":"鉴别为真",
        "createTime":"2021-02-28 10:50:52.000",
        "modifyTime":"2021-02-28 10:50:52.000",
        "feature":""
    },
    "evaluationFlag":"NO",
    "isSelf":0,
    "deliveryStartTime":"2021-02-28 10:51:54.675",
    "deliveryDeadline":"2021-02-28 11:50:55.000",
    "tabTag":0,
    "appType":0,
    "agreeSevenDayWithoutReason":false,
    "orderFlag":0,
    "relationSubOrderList":[

    ],
    "commentList":[

    ],
    "agreedAutoExchange":false,
    "sevenDayNoReasonStatus":false,
    "warehousing":false,
    "liveFlag":"NO",
    "skipCheckFlag":"NO",
    "autoExchangeSwitch":false,
    "freightInsuranceChecked":false,
    "subsidyMap":{
        "-1":0
    },
    "crossBorderPostType":0,
    "tradeSuccessTime":"2021-03-07 10:50:59.194",
    "biddingAfterSaleInfo":{
        "sellerBiddingNo":"102020031000861366",
        "afterSalesType":0
    },
    "additionBiddingAfterSaleInfo":[

    ],
    "bizInstanceId":{
        "bizCode":"duapp.general",
        "bizInstanceId":"510100016560346748"
    },
    "unconditionalReturnInBuyerVersion":false,
    "unconditionalReturnInSellerVersion":false
}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 202,905评论 5 476
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,140评论 2 379
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 149,791评论 0 335
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,483评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,476评论 5 364
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,516评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,905评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,560评论 0 256
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,778评论 1 296
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,557评论 2 319
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,635评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,338评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,925评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,898评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,142评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,818评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,347评论 2 342

推荐阅读更多精彩内容