Java.Lang.NoSuchMethod Error

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.