java反射类InvocationTargetException深度剖析,底层问题定位

Owen_Blog 发布于 2019/09/27 16:42
阅读 290
收藏 0

2019-09-27 16:10:43,461 rent com.isesol.rent.platform.service.BizLogService.doBizLog(84) doBizLog 错误 executor:orderDisposeLog,bizLogDefine id:3
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_92]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_92]

at com.isesol.rent.platform.service.BizLogService.doBizLog(BizLogService.java:80) ~[rent-core-service-2.4.3-SNAPSHOT.jar:2.4.3-SNAPSHOT]
at com.isesol.rent.platform.mq.consumer.BizLogConsumer.lambda$doConsumeMessage$0(BizLogConsumer.java:63) ~[rent-core-service-2.4.3-SNAPSHOT.jar:2.4.3-SNAPSHOT]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) [spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at com.isesol.rent.platform.mq.consumer.BizLogConsumer.doConsumeMessage(BizLogConsumer.java:49) [rent-core-service-2.4.3-SNAPSHOT.jar:2.4.3-SNAPSHOT]
at com.isesol.arch.common.mq.BaseConsumer.consumeMessage(BaseConsumer.java:183) [isesol-common-1.0.0.jar:1.0.0]
at com.alibaba.rocketmq.client.impl.consumer.ConsumeMessageConcurrentlyService$ConsumeRequest.run(ConsumeMessageConcurrentlyService.java:413) [rocketmq-client-3.5.9.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_92]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_92]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_92]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_92]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_92]
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at com.isesol.rent.platform.service.BizLogService.orderDisposeLog(BizLogService.java:157) ~[rent-core-service-2.4.3-SNAPSHOT.jar:2.4.3-SNAPSHOT]
... 15 more

 

目标方法:

try {
    Class  clazz  = this.getClass();
    Method method = clazz.getMethod(executor, String.class, TRentLogBiz.class, JSONObject.class);
    tRentLogBiz = (TRentLogBiz) method.invoke(this, logTemp, tRentLogBiz, restResponse);
} catch (NoSuchMethodException e) {
    LOGGER.error("doBizLog 没有找到方法" + executor + ",bizLogDefine id:" + tRentLogBizDefine.getId(), e);
} catch (Exception e) {
    LOGGER.error("doBizLog 错误 executor:" + executor + ",bizLogDefine id:" + tRentLogBizDefine.getId(), e);
}

 

public TRentLogBiz orderDisposeLog(String logTemp, TRentLogBiz tRentLogBiz, JSONObject restResponse) {
.....
}

 

描述:

目前困惑在这里,想请大牛指导一下问题的定位排查

跪谢啊

 

 

加载中
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部