当前位置: 代码迷 >> Ruby/Rails >> Parse Fatal Error at line 41 column 24: 元素部类 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止
  详细解决方案

Parse Fatal Error at line 41 column 24: 元素部类 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止

热度:430   发布时间:2016-04-29 02:13:43.0
Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止

1、错误描述

严重: Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止。org.xml.sax.SAXParseException; systemId: jndi:/localhost/SpringMVCH/WEB-INF/web.xml; lineNumber: 41; columnNumber: 24; 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止。	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1749)	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2973)	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)	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:848)	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)	at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1825)	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1263)	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889)	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5380)	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245)	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895)	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)	at java.util.concurrent.FutureTask.run(FutureTask.java:262)	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)	at java.lang.Thread.run(Thread.java:745)四月 29, 2015 10:44:26 下午 org.apache.catalina.startup.ContextConfig parseWebXml严重: Parse error in application web.xml file at jndi:/localhost/SpringMVCH/WEB-INF/web.xmlorg.xml.sax.SAXParseException; systemId: jndi:/localhost/SpringMVCH/WEB-INF/web.xml; lineNumber: 41; columnNumber: 24; 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止。	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1749)	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2973)	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)	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:848)	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)	at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1825)	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1263)	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889)	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5380)	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245)	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895)	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)	at java.util.concurrent.FutureTask.run(FutureTask.java:262)	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)	at java.lang.Thread.run(Thread.java:745)四月 29, 2015 10:44:26 下午 org.apache.catalina.startup.ContextConfig parseWebXml严重: Occurred at line 41 column 24四月 29, 2015 10:44:26 下午 org.apache.catalina.startup.ContextConfig configureStart严重: Marking this application unavailable due to previous error(s)四月 29, 2015 10:44:26 下午 org.apache.catalina.core.StandardContext startInternal严重: Error getConfigured四月 29, 2015 10:44:26 下午 org.apache.catalina.core.StandardContext startInternal严重: Context [/SpringMVCH] startup failed due to previous errors

2、错误原因

 <filter-mapping>	<filter-name>CharacterEncodingFilter</filter-name>	<url-pattern>/*</url-pattrn></filter-mapping>
   <url-pattern>/*</url-pattrn>开始标签和结束标签不一致


3、解决办法

<filter-mapping>	<filter-name>CharacterEncodingFilter</filter-name>	<url-pattern>/*</url-pattern></filter-mapping>


  相关解决方案