When I run a project which was worked fine in Tomcat 5.5 on Tomcat 6.0, some error bumped out:

 Jul 12, 2007 3:01:11 PM com.xxxx.xxx.xxx.RendererException <init>
SEVERE: Couldn’t include the view: ‘/WEB-INF/templates/jsp/xxx.jsp’. java.lang.ClassCastException: org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor

Found the reason & solution here:

This was due to efforts from MYFACES-1246, proposal of annotation
processing here in list (adding method), but this of course breaks
compatibility of the same named interfaces.

If you have older code using org.apache.AnnotationProcessor you can make
it work on Tomcat:

Add

<Loader delegate="true"/>

into context.xml file (to Context element) in tomcat/conf directory.
This makes classloading in Tomcat sticking to J2EE spec.
(I couldn't make it work with suggested approach for only 1 webapp)

More info on classloader:
http://tomcat.apache.org/tomcat-6.0-doc/config/loader.html

Popularity: 13% [?]



One Comment to “Problem u& solution of using org.apache.AnnotationProcessor in Tomcat 6”

  1. Bal | July 17th, 2008 at 6:09 am

    Thanks ;)

Leave a Comment

Close
E-mail It
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.