tomcat部署项目报错NoSuchMethodException#addServlet,addFilter
java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet
java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addFilter
这个问题折腾了我三四天,现在终于找到原因了。
是web-inf/lib包下包含了catalina.jar这个jar包,导致加载的时候使用了这个jar但是没有找到addServlet,addFilter
解决方法:Go to your WEB-INf/lib and remove catalina.*.jar, then restart your tomcat.
还是老外的网站牛逼。百度了几天答案千篇一律:解决方法为:在Tomacat7的context.xml文件里的<Context>中加上<Loader delegate="true" />
http://nvry.iteye.com/blog/1726163
|
1
2
3
4
|
<
Context
>
<
WatchedResource
>WEB-INF/web.xml</
WatchedResource
>
<
Loader
delegate="true" />
</
Context
>
|
可能能解决某些人的问题吧,反正解决不了我的问题。
######################
另一个问题:WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:firstProject' did not find a matching property.
这个教程对这个问题很全面的解决和分析
########## 还有一个问题 ###############
The method list(String, Object[]) is ambiguous for the type BaseDAOImpl<M,PK
原因:eclipse 的一个bug,具体见
http://stackoverflow.com/questions/10852923/method-is-ambiguous-for-the-type-but-the-types-are-not-ambigues-and-the-error 。
解决方法:在eclipse.ini -vmargs后面添加 -DtolerateIllegalAmbiguousVarargsInvocation=true ;重启eclipse,并clean一下项目 重新编译即可。
本文详细介绍了在使用Tomcat部署项目时遇到的NoSuchMethodException异常,特别是addServlet和addFilter方法未找到的问题及其解决方案。同时,还讨论了如何解决Setting property 'source'警告以及方法list(String,Object[])在BaseDAOImpl类中的歧义问题。
755

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



