美文网首页
Arthas利用Spring容器获取对象 调用实例方法 线上问题

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

作者: 小王_min | 来源:发表于2021-03-30 09:56 被阅读0次

    启动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
    }
    
    

    相关文章

      网友评论

          本文标题:Arthas利用Spring容器获取对象 调用实例方法 线上问题

          本文链接:https://www.haomeiwen.com/subject/fmywhltx.html