[url]http://mqqqvpppm.iteye.com/blog/220254[/url]
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
出现这个问题多半是把tomcat6 lib目录下的jar文件复制到了项目lib目录下了,只需要把这些多余的jar包从项目lib目录下去掉就行了。
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
出现这个问题多半是把tomcat6 lib目录下的jar文件复制到了项目lib目录下了,只需要把这些多余的jar包从项目lib目录下去掉就行了。