xml缺少xsd报错:需要再头文件添加其

Description    Resource    Path    Location    Type cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'cache:annotation-driven'

这类错误,一般就是要修改两个地方:百度上好多都是说一个地方,然后下面评论为什么还报错

我这个是少了spring缓存的

应该这么添加3处缺一不可:

具体代码如下

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:mybatis-spring="http://mybatis.org/schema/mybatis-spring"
	xmlns:cache="http://www.springframework.org/schema/cache"
	xsi:schemaLocation="http://mybatis.org/schema/mybatis-spring http://mybatis.org/schema/mybatis-spring-1.2.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
		http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-4.3.xsd ">

猜你喜欢

转载自blog.csdn.net/LNB2233/article/details/85259756