---
title: "修改项目名称 SAXParseException"
author: "zhb8015"
date: "2014-08-02T15:32:47Z"
tags: []
categories: ["企业架构"]
slug: "saxparseexception"
draft: false
lastmod: "2014-08-02T15:32:47Z"
id: 2099545
url: "https://peter8015.iteye.com/blog/2099545"
---

在修改项目名称时，经常遇到以下报错：

```
八月 02, 2014 3:28:45 下午 org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Parse error in application web.xml file at jndi:/localhost/trade/WEB-INF/web.xml
org.xml.sax.SAXParseException; systemId: jndi:/localhost/trade/WEB-INF/web.xml; lineNumber: 2; columnNumber: 193; 
已经为元素 "web-app" 指定属性 "xmlns"。
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
```

 原因：红色部分重复，删掉一行即可

```
<?xml version="1.0" encoding="ISO-8859-1"?>
<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" version="2.5">
 
```