org.xml.sax.SAXParseException: The markup in the document following the root element must be well-fo

来源:互联网 发布:somachine编程手册 编辑:程序博客网 时间:2024/06/05 12:50

部署项目报错:org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.

此句的一看就是xml文件的错,文档中标记的地方格式不合法,通不过dtd的验证,所以要符合规范,在xml文件的开头加上

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"></web-app>
这样就符合规范了。