定义mongo时出错:存储库

时间:2013-04-02 14:34:52

标签: java mongodb spring-data spring-data-mongodb

运行Junit测试时出现此错误

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 15 in XML document from class path resource [mongo-test-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 89; cvc-complex-type.2.4.a: Invalid content was found starting with element 'mongo:repository'. One of '{"http://www.springframework.org/schema/data/repository":include-filter, "http://www.springframework.org/schema/data/repository":exclude-filter}' is expected.

这是我的相关弹簧配置文件

<mongo:mongo id="mongoConnection" host="localhost" port="27017" />
<mongo:repositories base-package="gov.ic.isso.ce.data">
    <mongo:repository id="dictionaryService" mongo-template-ref="dictionaryTemplate" />
</mongo:repositories>

以下是我在pom.xml文件中定义的依赖项

<dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
          <version>3.2.1.RELEASE</version>
      </dependency>

      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.2.1.RELEASE</version>
      </dependency>

      <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongo-java-driver</artifactId>
        <version>2.9.3</version>
      </dependency>

      <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-mongodb</artifactId>
        <version>1.1.1.RELEASE</version>
      </dependency>

0 个答案:

没有答案