1. 程式人生 > >xml缺少xsd報錯:需要再標頭檔案新增其

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