【问题标题】:Eclipse "Creation of Element Failed"Eclipse“创建元素失败”
【发布时间】:2010-01-15 16:01:32
【问题描述】:

我使用的是基于 Eclipse 3.x 构建的 WID 6.1。

当尝试右键单击文件夹时,新建->类,键入类的名称,然后单击完成,我收到错误

"创建元素失败。 org.xml.sax.SAXParseException: 文件过早结束。”

昨天发生这种情况时,我重新创建了我的工作区,但现在又发生了。重新安装 WID 需要两三个小时,所以我更愿意解决实际问题。

建议?

edit: 在第二次重新启动 WID 后,我现在收到“初始化 Java 工具时出错。”, 比我原来的错误消息更易于搜索得到。

编辑:查看 WID/Eclipse 日志,有一个异常,但它没有告诉我哪个项目或哪个文件。

Caused by: org.xml.sax.SAXParseException: Premature end of file.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
    at org.eclipse.wst.common.internal.emf.utilities.DOMUtilities.loadDocument(Unknown Source)
    ... 21 more

【问题讨论】:

    标签: eclipse saxparseexception wid


    【解决方案1】:

    点击窗口、显示视图、错误日志。

    从工作区中删除所有项目。

    将项目一一重新加载到工作区,查看错误日志。

    对于导致加载错误的项目,进入他们的 .settings 文件夹并看到那里的文件是空的和/或 0 字节。将它们全部删除,它又可以工作了。

    【讨论】:

      猜你喜欢
      • 2013-05-13
      • 1970-01-01
      • 1970-01-01
      • 2019-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多