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.