调用后端服务zzz抛异常:java.lang.NoSuchMethodError,服务不可用。 异常信息: java.lang.RuntimeException: java.lang.NoSuchMethodError: com.xxx.service.yyyServiceImpl.zzz(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;)Ljava/util/List; at com.rop.impl.AnnotationServiceMethodAdapter.invokeServiceMethod(AnnotationServiceMethodAdapter.java:56) at com.rop.impl.AnnotationServletServiceRouter.doService(AnnotationServletServiceRouter.java:655) at com.rop.impl.AnnotationServletServiceRouter.access$600(AnnotationServletServiceRouter.java:43) at com.rop.impl.AnnotationServletServiceRouter$ServiceRunnable.run(AnnotationServletServiceRouter.java:453) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NoSuchMethodError: com.xxx.service.yyy.zzz(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;)Ljava/util/List; at com.xxx.controller.yyyController.zzz(yyyController.java:1856) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.rop.impl.AnnotationServiceMethodAdapter.invokeServiceMethod(AnnotationServiceMethodAdapter.java:48) ... 8 more问题描述:本地开发调试一切正常,发布到正式环境出现如上错误
想了无数种可能(jdk版本不同,返回Map未设置K,V等)
最后灵光一闪,或许是加载的接口不是我写的接口(果然另外一同事提交到maven中的jar有此接口)
总结,若再遇到此类问题要从重复类找起。
1
1