严重: Parse Error at line 52 column -1: 组件“web-app”在此不允许“servlet-mapping”。
org.xml.sax.SAXParseException: 组件“web-app”在此不允许“servlet-mapping”。
at org.apache.crimson.parser.Parser2.error(Parser2.java:3354)
at org.apache.crimson.parser.ValidatingParser$ChildrenValidator.consume(ValidatingParser.java:349)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1497)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at org.apache.commons.digester.Digester.parse(Digester.java:1745)
at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:221)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:580)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:182)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3644)
at org.apache.catalina.startup.HostConfig.checkWebXmlLastModified(HostConfig.java:681)
at org.apache.catalina.startup.HostConfig.run(HostConfig.java:921)
at java.lang.Thread.run(Thread.java:534)
今天在将项目部署到tomcat-4.1.36-LE时,报出上面的错误,而实际上并不会影响程序执行。后来将所有的servlet放在一起,所有的servlet-mapping放在一起后,问题解决。故猜测,tomcat这个版本应该是对web的较验方式引起。在5以后的版本没有该问题。