测试tomcat的comet

Java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet 异常

因为工程中用到tomcat的catalina.jar,被部署到tomcat中时,这个包也跟着部署进去了,部署报异常

2012-7-27 11:44:05 org.apache.catalina.startup.ContextConfig parseWebXml
严重: Parse error in application web.xml file at jndi:/localhost/tomcat-comet/WEB-INF/web.xml
java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2687)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2713)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1060)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1543)
at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1694)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1209)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:882)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5081)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1279)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1360)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1233)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1391)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1380)
at java.lang.Thread.run(Thread.java:619)

开始以为是web.xml文件写错了,检查了没问题,后来搜索才发现是包冲突

修改包的部署配置

右键project-> Properties-> myeclipse-> web -> deployment 修改 Lib...Policies
 
取消 default
取消 jars from build path

(只勾选下面三个)

最新文章

  1. 在 Linux 中使用搜狗拼音输入法以及搞定 Flash 和支付宝
  2. SOAPUI使用教程-MockServices工作原理
  3. zTree Jquery eCharts
  4. C++编程优化心得(持续更新)
  5. OC-分类
  6. Android Studio开发环境变量配置
  7. swift Dictionary 字典
  8. java工厂类与反射机制
  9. IOS应用FFMPEG库
  10. 【Kafka源码】ReplicaManager启动过程
  11. (floyd)佛洛伊德算法
  12. div宽高不确定,内容居中
  13. 在VS2015中用C++编写可被C#调用的DLL
  14. linux yum 本地源配置
  15. 用AOP思想改造一个服务器的数据存储
  16. Spring+SpringMVC+MyBatis整合基础篇(三)搭建步骤
  17. mysql故障
  18. sql 语句执行顺序
  19. js-form表单元素的自定义属性
  20. Beta阶段第2周/共2周 Scrum立会报告+燃尽图 04

热门文章

  1. 创建react
  2. guacamole实现上传下载
  3. Ubuntu下使用Git_2
  4. volatility的使用
  5. POSTMAN——环境变量
  6. 1034 Head of a Gang (30 分)(图的遍历or并查集)
  7. Visual Studio 2005安装包
  8. POJ 2162 Document Indexing(模拟)
  9. 并查集——poj1703(带权并查集入门)
  10. rcnn caffe matlab 配置完成 14.04 cuda 7.0