chord91
chord91
采纳率50%
2016-05-27 06:14

用eclipse更改项目名称后报xml错误

已采纳

用eclipse更改项目名称后报错
然后我又把项目名称改为原来的名称,运行项目时报XML错误
但小项目之前是能够正常运行的,只做了一个改变名称的操作。
实际错误如下,求大神帮助一下,十万火急啊!

五月 27, 2016 1:34:52 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
五月 27, 2016 1:35:01 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet 'spring'
五月 27, 2016 1:35:04 下午 org.apache.tomcat.util.digester.Digester fatalError
严重: Parse Fatal Error at line 2 column 193: 已经为元素 "web-app" 指定属性 "xmlns"。
org.xml.sax.SAXParseException; systemId: jndi:/localhost/zhuanquanziweb/WEB-INF/web.xml; lineNumber: 2; columnNumber: 193; 已经为元素 "web-app" 指定属性 "xmlns"。
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1555)
at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1843)
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:5405)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

3条回答

  • qq371522 不知道不代表不存在 5年前

    web.xml文件 中是不是有一行红线 应该是重复啦 要不你去web.xml (Ctrl+F)搜一下 xmlns 应该是重复的问题

    可以看下这篇文章 http://blog.csdn.net/zjrodger/article/details/45149019

    点赞 1 评论 复制链接分享
  • chord91 chord91 5年前

    感谢,我有两个项目,一起运行的,之前在网上搜到那个解决方案的。不过粗心只改了一个项目的xml。刚刚都改了,就好了

    点赞 评论 复制链接分享
  • qq_34827338 qq_34827338 5年前

    xmlns 多写了 ,你找到这个地方 应该是它的有部分内容写重了

    点赞 评论 复制链接分享