Eclipse报错:Attribute "xmlns" was already specified for element "web-app".

原因:

在Eclipse中修改了已有的Web工程的工程名,然后出现该错误。

Attribute "xmlns" was already specified for element "web-app".

 

检查web.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

确实是出现了两次:xmlns="http://java.sun.com/xml/ns/javaee"

 

解决方法:

删掉一个即可。

posted @ 2017-12-08 11:24  无涯的风  阅读(1934)  评论(0编辑  收藏  举报