【问题标题】:<cache:advice..../> property causes error when tomcat 6 starts<cache:advice..../> 属性在 tomcat 6 启动时导致错误
【发布时间】: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


    【解决方案1】:

    尝试将 spring-beans.xsd 从 http://www.springframework.org/schema/beans/spring-beans.xsd 更改为 http://www.springframework.org/schema/beans/spring-beans-3.1.xsd

    如果它不能帮助显示您的应用程序的所有依赖项(包括版本)。

    【讨论】:

      猜你喜欢
      • 2012-10-18
      • 1970-01-01
      • 1970-01-01
      • 2016-07-29
      • 2011-05-24
      • 2013-01-07
      • 2022-12-17
      • 2012-06-23
      • 2018-09-28
      相关资源
      最近更新 更多