solve ClassCastException of AnnotationProcessor

my project throw the following exception in tomcat6:

java.lang.ClassCastException:
org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor


Solution:

(this is an expert's mail)
-----------------------------------------------------------------------
  this problem is not easy to solve - some1 commited "patch" to refactor
AnnotationProcessor interface to NOW wrong package.
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

When using new code from trunk, it needs quite a lot changes to make it
work in Tomcat (i can provide patch if wanted).

Regards,
  Zdenek



------------------------------------------------------------------------

你可能感兴趣的:(apache,html,tomcat,xml)