Problems encountered in telecom projects----->>><2> java.lang.NoSuchMethodError problem Handling

Source: Internet
Author: User

The problem encountered this time is still the jar package conflict encountered problems, resulting in the jar package class conflicts so that the method error,java.lang.NoSuchMethodError.

The solution also begins to isolate the jar package, decompile the contents of the jar package and other jar package pairs. It's all in the eye. If there's MAVEN, it's not going to be so much, but.

Another line of projects, the migration to MAVEN can not guarantee that there will not be any moth, it can only be this, will only be the gradual migration of the people.

Later, I wanted to have a way to output the path of the jar where the class is located in Java.

String className = Request.getparameter ("ClassName"); PrintWriter PrintWriter=NewPrintWriter (Response.getwriter ()); if(ClassName = =NULL||Classname.isempty ()) {Printwriter.write ("ClassName shoud be specified"); }Else{Class<?> Clazz =NULL; Try{clazz=Class.forName (className); }Catch(Exception e) {}if(Clazz = =NULL) {printwriter.println (ClassName+ "Not Found"); }Else{Codesource Codesource=Clazz.getprotectiondomain (). Getcodesource (); if(Codesource = =NULL) {printwriter.println (ClassName+ "Location not available"); }Else{String location=codesource.getlocation (). GetPath (); Printwriter.println (ClassName+ "Location:" +Location );  }}} Printwriter.flush (); 

This is the core code, originally intended to write an action, see the Internet has to write it into the JSP more convenient.

Problems encountered in telecom projects----->>><2> java.lang.NoSuchMethodError problem Handling

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.