0

我坚持使用我正在维护的独立 java 应用程序,我对 Maven 真的很陌生。我在命令行中使用复制依赖项、包插件和一切正常,但是当我在 Eclipse 中看到项目时,它验证了项目,似乎检查哪个 .xsd 版本应该考虑到问题。

说明资源路径位置类型 src-resolve:无法将名称“beans:identifiedType”解析为(n)“类型定义”组件。spring-jee-2.0.xsd
描述资源路径位置类型 src-resolve:无法将名称“beans:identifiedType”解析为(n)“类型定义”组件。spring-jee-2.5.xsd

我正在使用 spring 2.5.6,我无法升级。我不知道我是否必须在我的 Eclipse IDE 中设置一些东西。

我的配置文件是这样的:

<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:util="http://www.springframework.org/schema/util"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">

有什么想法或建议吗?是否与项目中的问题或 Eclipse IDE 有关?

提前致谢

4

1 回答 1

0

我无法重现您的情况,但似乎与此问题有关:

这是 STS 的一个特性(试图聪明并从项目类路径中导入 XSD,但无法找到 spring 核心)。如果您想真正解决问题,请在那里提出 JIRA 票,但我的理解是这是一种妥协 - 不编辑自定义 XSD 的用户比那些编辑的用户要多得多,因此最好支持更大的群体。

您可以通过将 spring-beans-3.1.xsd 添加到 Eclipse 中的 XML 目录来解决它(查看 Preferences)。您可能只需要指定一个命名空间 id,但我总是添加架构位置以确保安全。您可能需要从 spring jar 文件中提取 XSD,因为我认为您不能从 jar 中添加目录条目。

因此,尝试将 spring-beans-2.5.xsd 添加到 Eclipse 中的 XML 目录中。希望这可以帮助。

于 2013-05-23T07:43:08.583 回答