1

运行 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>
4

0 回答 0