5

I am getting the following error and not been able to solve it n googling was not fruitful either. please help.

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..."

this is my code.

<?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>       

I tyried many things. i feel its some dependency problem. Please help.

Droidme
  • 1,223
  • 6
  • 25
  • 45

2 Answers2

13

I had the same problem starting several days ago and I changed 1.0 to 1.1 then the problem is gone. It seems they have changed the xsd file.

http://www.springframework.org/schema/data/mongo/spring-mongo-1.1.xsd 
bekce
  • 3,782
  • 29
  • 30
0

I hit this too. The problem is hard coded imports in the Spring data XSD file. I removed the imports in schemaLocation for context and bean and made the errors go away.

More info is here

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

and here

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

Will Glass
  • 4,800
  • 6
  • 34
  • 44