caching - Spring Cache Configuration -
this 1 seems simple question. when effort run or compile maven project in eclipse, error:
severe: servlet /articleservices threw load() exception org.xml.sax.saxparseexception; linenumber: 73; columnnumber: 32; prefix "p" attribute "p:name" associated element type "bean" not bound. @ org.apache.xerces.util.errorhandlerwrapper.createsaxparseexception(unknown source) @ org.apache.xerces.util.errorhandlerwrapper.fatalerror(unknown source) @ org.apache.xerces.impl.xmlerrorreporter.reporterror(unknown source) @ org.apache.xerces.impl.xmlerrorreporter.reporterror(unknown source)..
note truncated error message since believe root quite self-explanatory...but no matter how much around , check, doesn't seem there's wrong configuration file, follows:
<?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:aop="http://www.springframework.org/schema/aop" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:cache="http://www.springframework.org/schema/cache" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd"> <context:component-scan base-package="mylittlecacheproject" /> <mvc:resources mapping="/**" location="/" /> <!-- enables spring mvc @controller programming model --> <mvc:annotation-driven /> <!-- annotation caching --> <cache:annotation-driven /> <!-- enables aspjectj model --> <aop:aspectj-autoproxy proxy-target-class="true" /> <!-- validator --> <bean id="validator" class="org.springframework.validation.beanvalidation.localvalidatorfactorybean" /> <!-- resolve logical view names .jsp resources in /web-inf/views directory --> <bean class="org.springframework.web.servlet.view.internalresourceviewresolver"> <property name="prefix" value="/web-inf/jsp/" /> <property name="suffix" value=".jsp" /> <property name="order" value="3" /> </bean> <!-- xmlconverter injection --> <bean id="xmlconverter" class="mppiwebservices.utils.xml.xmlconverter"> <property name="marshaller" ref="castormarshaller" /> <property name="unmarshaller" ref="castormarshaller" /> </bean> <bean id="castormarshaller" class="org.springframework.oxm.castor.castormarshaller"> <property name="mappinglocation" value="classpath:rssmapping.xml" /> <property name="ignoreextraelements" value="true" /> </bean> <!-- generic cache manager --> <bean id="cachemanager" class="org.springframework.cache.support.simplecachemanager"> <property name="caches"> <set> <bean class="org.springframework.cache.concurrent.concurrentcachefactorybean" p:name="rsspassthrough" /> </set> </property> </bean> </beans>
okay i'm lazy clip out other beans used in project, question be...am specifying right schema location spring's cache? or missing here?
finally found it, in spring documentation, namespace xmlns:p="http://www.springframework.org/schema/p"
was not included in illustration configuration.
spring caching
No comments:
Post a Comment