我在Eclipse中有一个maven-spring工程,其中一个spring上下文出现了这个烦人的错误消息:
引用的文件包含错误(jar:file:/M2_HOME/repository/org/springframework/spring-beans/3.1.2.RELEASE/spring-beans-3.1.2.RELEASE.jar!/org/springframework/beans/ factory/xml/spring-tool-3.1.xsd)。欲了解详细信息,请右键单击问题视图中的消息并选择“显示详细信息…”
在“显示详细信息”中看到以下内容:
我正在使用spring-data-jpa 1.2.0.RELEASE,我的其他spring jar版本为3.1.3.RELEASE。关于spring-data-commons-core-我甚至在我的POM中都没有依赖它,但我可以在我的m2存储库中找到它以及spring-data-commons-parent,两者的版本均为1.4.0.RELEASE。我不知道为什么会这样(也许它们是spring-data-jpa的一部分?)
我的应用程序上下文模式如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.2.xsd">
我不明白为什么我一直会遇到这个错误。基本上它没有任何效果,应用程序编译、部署和运行都很好,只是这个让我疯狂的恼人的红色错误标记在Eclipse中。