我有以下spring servlet-context.xml文件:
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.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/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
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">
我在文件中遇到以下错误:
验证文件时检测到以下错误 “spring-mongo-1.0.xsd”通过文件“servlet-context.xml”。多数情况 这些错误可以通过验证来检测 “spring-mongo-1.0.xsd”直接。但是有可能出错 只有在上下文中验证spring-mongo-1.0.xsd时才会发生 servlet-context.xml。
src-resolve:无法将名称'repository:repository'解析为(n)'类型定义'组件位置:第110行
该项目仍然有效,但我试图摆脱这个错误。有什么想法吗?
答案 0 :(得分:0)
根据@francadaval,解决方案是将指向xsd的链接更改为:
springframework.org/schema/data/mongo/spring-mongo.xsd