0

We using spring 3.2.3 in a jsf-based web app. I'm tasked with implementing spring cache WITHOUT using annotations. here's my cache-context:

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

When tomcat 6 starts, I get this error: ...org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'cache:advice'.

I don't understand why, am I missing something in my pom or xml declaration? Please help

Vuzi
  • 185
  • 2
  • 4
  • 13

1 Answers1

0

Try to change spring-beans.xsd from http://www.springframework.org/schema/beans/spring-beans.xsd to http://www.springframework.org/schema/beans/spring-beans-3.1.xsd.

If it doesn't help show all dependencies (including version) of your application.

ragnor
  • 2,498
  • 1
  • 22
  • 25