tomcat6 AnnotationProcessor 的问题

本文介绍了一位开发者在尝试将基于Tomcat5.5的Web应用迁移至Tomcat6过程中遇到的ClassCastException错误,并详细记录了解决此问题的过程。最终通过在context.xml文件中为context元素添加<Loader delegate=true/>配置解决了部署问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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" />
即可
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值