1.错误日志:
调用后端服务djOrder.getOrderListByPage抛异常:java.lang.NoSuchMethodError,服务不可用。\n异常信息:\njava.lang.RuntimeException: java.lang.NoSuchMethodError: com.sfAPI.api.dianjiang.service.DJOrderService.listResponse(Ljava\/util\/ArrayList;)Lcom\/sfAPI\/api\/response\/common\/ListResponse;\n\tat com.rop.impl.AnnotationServiceMethodAdapter.invokeServiceMethod(AnnotationServiceMethodAdapter.java:54)\n\tat com.rop.impl.AnnotationServletServiceRouter.doService(AnnotationServletServiceRouter.java:515)\n\tat com.rop.impl.AnnotationServletServiceRouter.access$600(AnnotationServletServiceRouter.java:40)\n\tat com.rop.impl.AnnotationServletServiceRouter$ServiceRunnable.run(AnnotationServletServiceRouter.java:349)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:262)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n\tat java.lang.Thread.run(Thread.java:745)\nCaused by: java.lang.NoSuchMethodError: com.sfAPI.api.dianjiang.service.DJOrderService.listResponse(Ljava\/util\/ArrayList;)Lcom\/sfAPI\/api\/response\/common\/ListResponse;\n\tat com.sfAPI.api.dianjiang.service.DJOrderService.getOrderListByPage(DJOrderService.java:75)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:606)\n\tat com.rop.impl.AnnotationServiceMethodAdapter.invokeServiceMethod(AnnotationServiceMethodAdapter.java:46)\n\t... 8 more\n
2.关键错误代码:java.lang.NoSuchMethodError: com.sfAPI.api.dianjiang.service.DJOrderService.listResponse(Ljava\/util\/ArrayList;)Lcom\/sfAPI\/api\/response\/common\/ListResponse。
分析:找不到DJOrderService类中 ListResponse listResponse(ArrayList list);方法。原因:修改了DJOrderService父类listResponse方法参数ArrayList为List,Build Artifacts后,只把DJOrderService父类的class文件更新到服务器中,而DJOrderService类生成的新的class文件没有更新到服务器中。
3.注意:修改父类方法参数类型,要考虑子类调用该方法产生的影响。