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
------------------------------------------------------------------------
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中遇到的java.lang.ClassCastException异常问题,该问题是由于新旧AnnotationProcessor接口不兼容导致的。解决方案是在context.xml文件中加入<Loader delegate=true/>来确保类加载符合J2EE规范。
1558

被折叠的 条评论
为什么被折叠?



