我们在基于 jsf 的 Web 应用程序中使用 spring 3.2.3。我的任务是在不使用注释的情况下实现 spring缓存。这是我的缓存上下文:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cache="http://www.springframework.org/schema/cache"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
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-3.1.xsd
http://www.springframework.org/schema/cache/spring-cache-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd">
<cache:advice id="cacheProvider" cache-manager="cacheManager">
<cache:caching cache="findUsers">
<cache:cacheable method="findByUser" key="#userId"/>
<cache:cache-evict method="add" all-entries="true"/>
<cache:cache-evict method="delete" all-entries="true"/>
</cache:caching>
</cache:advice>
当 tomcat 6 启动时,我收到此错误:... org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: 匹配的通配符是严格的,但找不到元素“缓存:建议”的声明.
我不明白为什么,我的 pom 或 xml 声明中是否缺少某些内容?请帮忙