How to resolve Java.Lang.NoSuchMethod errors in Java development with method calls

Source: Internet
Author: User

Java Development calls WebService, method call reported Java.Lang.NoSucheMethod ..., the impression is the jar bundle conflict, MAVEN project, a look, this heap jar package ... With Eclipse's Pom visual interface, Dependency hierarchy see a lot of packet conflicts, starting with the WebService-dependent jar, and following this line of thought, a meal ruled out.


Online Search a few articles, combed the next problem-solving ideas:

1. This method is missing from the class you are tuning, possibly due to the incorrect version of the jar package

2, the project depends on the jar package, A and B packages have the same class (such as Class A), your goal is to call a package a class, the result was loaded after the B package covered, the result of inadvertently called B package a class

3, although the project has only a package, but your application server (container) contains B package, they contain the same class. I know from the Internet that the issue of Cxfwebservice in weblogic9.2


Since this is the case, do not start from the first guessing jar package conflict, but from the lack of methods of the class to start, trace its way.

First look at the wrong things I've come across:

Javax.servlet.ServletException:java.lang.NoSuchMethodError: **.**.client.clientbean.servicesoap.getorderbyid ( jzljava/util/list;) L**/**/client/clientbean/order;

This sentence has a classpath, in addition to the stack information provided in the exception, should be able to quickly locate which package in which class. Take a look in the class and there is no method you want to call (here is Getorderbyid). There are few cases in which there is no method in the package and the method is not expected to be invoked when writing code.

If so, see if the same package exists in the other package, the same class. I encountered today is such a mistake: Oom bag has servicesoap,order package and servicesoap, in the judgment Oom package unused, after, decisive row, the bug solved.




A java.lang.NoSuchMethodException exception occurred



The error message is as follows:

(wt.fc.fcresource/0) Wt.util.WTException: Operation: "Getibavalue" failed.
Nested exception is: wt.util.WTRemoteException: Cannot call remote method; Nested exceptions are:
Java.lang.NoSuchMethodException:ext.ckt.pdm.service.CKTServiceFwd.getIBAValue (Wt.doc.WTDocument, java.lang.String)



Method call Description: Because the Getibavalue () method is invoked in Windchill, it needs to be run at the Methodserver end, so it must be written to the service and then invoked through FWD.



The method affirms as follows:

public string Getibavalue (Ibaholder ibaholder, string name);

The problem is in the method variable, Ibaholder is an abstract interface, but the remote method call needs to instantiate the object, and the intermediate passed variables must be read and write (to be serialized and deserialized). In other words, the variable object must be the object that implements the Java.io.Serializable interface, Ibaholder obviously not, solid not.

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.