【发布时间】:2014-02-11 15:14:30
【问题描述】:
我们在基于 jsf 的 Web 应用程序中使用 spring 3.2.3。我的任务是使用注释实现 spring 缓存 WITHOUT。这是我的缓存上下文:
<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 声明中是否缺少某些内容?请帮忙
【问题讨论】:
标签: spring spring-cache