Org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to Org.apache

Source: Internet
Author: User

Publish a project when the project is made the following error occurred org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to Org.apache.AnnotationProcessor look at the error org.apache.catalina.util.DefaultAnnotationProcessor cannot is cast to Org.apache.AnnotationProcessor this error. Later look at the data to ask the group of friends, finally understand. Is Tomcat's Lib folder jar package and the project's lib file under a jar bundle conflict with the project under the Lib file and Tomcat's jar to delete all duplicates. The reason for the symptom on the internet is that the jar packet conflict, that is, Tomcat Catalina.jar and Jasper.jar have Annotationprocessor interface, so the runtime, there is a mistake: java.lang.ClassCastException : Org.apache.catalina.util.DefaultAnnotationProcessor. The mistake was finally taken care of. I hereby record that .... Note that if you first build the project and then turn it into a Web form, delete the Tomcat class library from the project, or it will conflict.

There are 2 solutions:

(1) To modify Tomcat's context configuration file
Add the following code between <context></context> <loader delegate= "true"/>
(2) Remove all duplicates of the item under Lib file and Tomcat jar.

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.