5

我收到以下错误并且无法解决它,谷歌搜索也没有成果。请帮忙。

Referenced file contains errors (http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd). For more 
 information, right click on the message in the Problems View and select "Show Details..."

这是我的代码。

<?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:mongo="http://www.springframework.org/schema/data/mongo"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/data/mongo
    http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <!--   replica-set="localhost:27017,localhost:27018" -->
    <context:annotation-config />
    <mongo:repositories base-package="com.kensho.dms.*" />
    <mongo:jmx/>
    <mongo:mongo host="192.168.55.2" port="27017" />
    <mongo:db-factory dbname="kenshodb" mongo-ref="mongo" />
    <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
        <constructor-arg name="mongo" ref="mongo"/>
        <constructor-arg name="databaseName" value="kenshodb"/>
     </bean>
     <bean id="mongoLoggedInUserDAO" class="com.kensho.nosql.MongoUserDAOImpl"  />


</beans>       

我厌倦了很多东西。我觉得它有一些依赖性问题。请帮忙。

4

2 回答 2

13

几天前我遇到了同样的问题,我将 1.0 更改为 1.1 然后问题就消失了。看来他们已经更改了 xsd 文件。

http://www.springframework.org/schema/data/mongo/spring-mongo-1.1.xsd 
于 2012-07-27T12:43:09.240 回答
0

我也打这个。问题在于 Spring 数据 XSD 文件中的硬编码导入。我删除了 schemaLocation 中上下文和 bean 的导入,并使错误消失。

更多信息在这里

http://forum.springsource.org/showthread.php?118643-xsd-validation-errors-in-Eclipse-when-using-spring-data

和这里

https://jira.springsource.org/browse/DATAJPA-160

于 2012-10-28T22:36:22.620 回答