Project development, call WebService, method call reported Java.Lang.NoSucheMethod ..., remember the jar package conflict, MAVEN project, a look, this heap of jar package ... With Eclipse's Pom visual interface, Dependency Hierarchy saw a lot of packet collisions, starting with the jar of WebService dependencies, and along this line of thinking, it didn't work.
On-line search several articles, combed the next problem-solving ideas:
1. The method is missing from the class you tuned, possibly due to the wrong version of the jar package
2, the project depends on the jar package, A and B packages have the same class (such as a class), your goal is to call the A-packet Class A, the result is loaded after the B package is overwritten, the result inadvertently called the B-Packet Class A
3, although the project is only a package, but your application server (container) contains the B package, they contain the same class. From the Internet to know in weblogic9.2 released Cxfwebservice have this problem
Since this is the case, it does not start with the jar-packet conflict, but begins with the class of the missing method.
First look at the error I encountered:
Javax.servlet.ServletException:java.lang.NoSuchMethodError: **.**.client.clientbean.servicesoap.getorderbyid ( jzljava/util/list;) L**/**/client/clientbean/order;
This sentence has a classpath, and in addition to the stack information provided in the exception, it should be able to quickly locate which class in the package. Take a look in the class, there is no method you want to call (here is Getorderbyid). There are few cases, there is no method in the package, and the method is not expected to be called when writing code.
If so, see if the same package, the same class, is present in the other package. The mistake I met today is this: Oom package has servicesoap,order bag and servicesoap, in judging the Oom package is not used, after, decisive platoon, the bug solved.
To increase the breadth and depth of knowledge, patient analysis should be a quick solution to the problem, everyone encouragement!
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Java.Lang.NoSuchMethod Error