`
budairenqin
  • 浏览: 199502 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

tomcat6 AnnotationProcessor 的问题

阅读更多
org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache

使用tuscany时导入jar包碰到的
我的解决办法是删掉catalina-6.0.14,它和tomcat6自带的jar包冲突。
下面是前人的解决办法

原文:
http://olivechinese.iteye.com/blog/365498
http://fykyx521.iteye.com/blog/379618

Hi,

I have a web application that was running on tomcat5.5. Now i want to deploy it on tomcat 6. when runing it, i got an error saying:

org.apache.jasper.JasperException: java.lang.ClassCastException:org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
        at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)

After a search, i found that DefaultAnnotationProcessor implements AnnotationProcessor and in tomcat 6 catalina.jar and jasper.jar both of them contains AnnotationProcessor interface in the same package. Some solution was suggested by kind people but it doesn't work for me, which is adding this line:

<Loader delegate="true" />

to the context element in the context.xml file of tomcat.

Did any body face this problem?

warm regards


根据上面的描述,并修改了tomcat里的context.xml文件,在context 元素下添加
<Loader delegate="true" /> 


I found the solution.

I inserted into server.xml <Loader delegate="true"/> in the context-element.

e.g.:

Code:

<Context path="/esg" reloadable="true" docBase="C:\workspace\esg\esg" workDir="C:\workspace\esg\esg\work">
<Loader delegate="true"/>
</Context>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics