java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet

三月 13, 2012 11:07:34 上午 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\develop-java\jdk7\bin;C:\develop-java\Tomcat7\bin
三月 13, 2012 11:07:34 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8080"]
三月 13, 2012 11:07:34 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
三月 13, 2012 11:07:34 上午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 298 ms
三月 13, 2012 11:07:34 上午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
三月 13, 2012 11:07:34 上午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.26
三月 13, 2012 11:07:34 上午 org.apache.catalina.startup.HostConfig deployWAR
信息: Deploying web application archive C:\develop-java\Tomcat7\webapps\blazeds.war
三月 13, 2012 11:07:35 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory C:\develop-java\Tomcat7\webapps\docs
三月 13, 2012 11:07:35 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory C:\develop-java\Tomcat7\webapps\FlexTest1
三月 13, 2012 11:07:35 上午 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(C:\develop-java\Tomcat7\webapps\FlexTest1\WEB-INF\lib\el-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
三月 13, 2012 11:07:35 上午 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(C:\develop-java\Tomcat7\webapps\FlexTest1\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
三月 13, 2012 11:07:35 上午 org.apache.tomcat.util.digester.Digester endElement
严重: End event threw exception
java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet
	at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:855)
	at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:201)
	at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1051)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endNamespaceScope(XMLDTDValidator.java:2054)
	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2005)
	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:879)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1741)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2898)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
	at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1825)
	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1201)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:345)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)

三月 13, 2012 11:07:35 上午 org.apache.catalina.startup.ContextConfig parseWebXml
严重: Parse error in application web.xml file at jndi:/localhost/FlexTest1/WEB-INF/web.xml
org.xml.sax.SAXParseException; systemId: jndi:/localhost/FlexTest1/WEB-INF/web.xml; lineNumber: 28; columnNumber: 15; Error at (28, 15) : 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:2719)
	at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1054)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endNamespaceScope(XMLDTDValidator.java:2054)
	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2005)
	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:879)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1741)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2898)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
	at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1825)
	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1201)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:345)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet
	at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:855)
	at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:201)
	at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1051)
	... 33 more

三月 13, 2012 11:07:35 上午 org.apache.catalina.startup.ContextConfig parseWebXml
严重: Occurred at line 28 column 15
三月 13, 2012 11:07:35 上午 org.apache.catalina.startup.ContextConfig configureStart
严重: Marking this application unavailable due to previous error(s)
三月 13, 2012 11:07:35 上午 org.apache.catalina.core.StandardContext startInternal
严重: Error getConfigured
三月 13, 2012 11:07:35 上午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/FlexTest1] startup failed due to previous errors
三月 13, 2012 11:07:35 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory C:\develop-java\Tomcat7\webapps\manager
三月 13, 2012 11:07:35 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory C:\develop-java\Tomcat7\webapps\ROOT
三月 13, 2012 11:07:35 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
三月 13, 2012 11:07:35 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
三月 13, 2012 11:07:35 上午 org.apache.catalina.startup.Catalina start
信息: Server startup in 1043 ms



前提描述:
开发环境:jdk7,tomcat7,myeclipse8.5,flex4集成创建flex项目部署到tomcat7中运行出现此错误。
解决方法:
把项目部署到tomcat7的webapps文件夹下,然后删除项目中的catalina.jar,再次启动tomcat7,运行正常。问题解决。

遗留问题:每次项目从新加载,都要删除一次;新创建项目也要删除一次;等待好办法。

你可能感兴趣的:(java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet)