背景:Arthas tt命令监控一个Controller方法异常
[arthas@30620]$ tt -t com.lbdj.business.rest.erp.ErpCommonOrderController getErpOrderList
Affect(class count: 1 , method count: 1) cost in 525 ms, listenerId: 1
Enhance error! exception: java.lang.UnsupportedOperationException: class redefinition failed: attempted to change the schema (add/remove fields)
error happens when enhancing class: class redefinition failed: attempted to change the schema (add/remove fields), check arthas log: /root/logs/arthas/arthas.log
排查:依据错误描述是arthas在修改类结构的时候发现已经被修改了,所以抛出异常。
编译前源码:
package com.lbdj.business.rest.erp;
import com.github.pagehelper.PageInfo;
import com.lbdj.business.request.common.ErpCommonOrderListRequest;
import com.lbdj.business.response.common.ErpOrderListResponse;
import com.lbdj.business.service.order.ErpCommonOrderDetatilService;
import com.lbdj.business.vo.ErpOrderListVo;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
public class ErpCommonOrderController {
@Resource
private ErpCommonOrderDetatilService commonOrderDetatilService;
@RequestMapping(value = "/ErpCommonOrderListRequest", method = RequestMethod.POST)
public Er