Arthas利用Spring容器獲取對象 調(diào)用實例方法 線上問題排查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,詳細(xì)指南: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)'

運行結(jié)果:

{
    "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":"上海上海市虹口區(qū)互聯(lián)寶地",
        "receiverAddress":"江蘇省南京市玄武區(qū)互聯(lián)寶地",
        "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":"虹口區(qū)",
        "address":"互聯(lián)寶地",
        "addressDetail":"上海上海市虹口區(qū)互聯(lián)寶地",
        "mobile":"1231232435435",
        "name":"得物白冰冰",
        "warehouseAddressType":"VIRTUAL",
        "zipCode":"",
        "warehouseCode":"SH12",
        "warehouseZoneCode":"YQSH01"
    },
    "buyerAddressInfo":{
        "userAddressId":1010004160,
        "userId":45816748,
        "province":"江蘇省",
        "city":"南京市",
        "district":"玄武區(qū)",
        "address":"互聯(lián)寶地",
        "addressDetail":"江蘇省南京市玄武區(qū)互聯(lián)寶地",
        "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":"西湖區(qū)",
        "address":"尷尬vv",
        "addressDetail":"浙江省杭州市西湖區(qū)尷尬vv",
        "mobile":"15618153285",
        "name":"溝溝壑壑",
        "countryCode":"",
        "modifyTimes":0,
        "zipCode":"",
        "optionalAddress":""
    },
    "poundageInfo":{
        "poundageInfoList":[
            {
                "expenseType":1,
                "expenseName":"技術(shù)服務(wù)費",
                "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":"轉(zhuǎn)賬手續(xù)費",
                "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":"包裝服務(wù)費",
                "originalExpense":1000,
                "currentExpense":1000,
                "extendJson":"{"currentExpense":1000,"originalExpense":1000}"
            },
            {
                "expenseType":7,
                "expenseName":"預(yù)計收入",
                "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":"質(zhì)檢通過",
        "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
}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容