我目前正在嘗試爲我的應用程序實現緩存,並且我面臨一個錯誤「cvc-complex-type.2.4.c:匹配通配符是嚴格的,但是對於元素'cache:annotation-driven'沒有聲明。」在我的pom.xml中。我在這裏錯過了什麼嗎?cvc-complex-type.2.4.c:匹配的通配符是嚴格的,但是對於元素'cache:annotation-driven'沒有聲明。
的pom.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:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:cache="http://www.springframework.org/schema/cache"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="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.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/cache
http://www.springframework.org/schema/cache/spring-cache.xsd
http://www.springframework.org/schema/tx/spring-tx.xsd">
<context:annotation-config />
<context:component-scan base-package="packages path" />
<!-- Enables the caching through annotations -->
<cache:annotation-driven />
<!-- Generic cache manager based on the JDK ConcurrentMap -->
<bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">
<property name="caches">
<set>
<bean
class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"
p:name="task" />
</set>
</property>
</bean>
啊我看看現在是如何工作的。謝謝您的幫助 :) – Sebastian