Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
How to configure ehCache Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to configure ehCache

    Hello,

    I've followed this tutorial:
    http://opensource.atlassian.com/conf...ng+and+EHCache but I'am not able to configure ehCache properly. The only thing I am trying to do is to cache the method getFecha from test.Fecha class.

    This is my xml config:

    <bean id="xsltController" class="test.XsltController">
    <property name="fecha" ref="fecha"/>
    </bean>

    <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheMa nagerFactoryBean">
    <property name="configLocation">
    <value>classpath:ehcache.xml</value>
    </property>
    </bean>

    <bean id="methodCache" class="org.springframework.cache.ehcache.EhCacheFa ctoryBean">
    <property name="cacheManager">
    <ref local="cacheManager"/>
    </property>
    <property name="cacheName">
    <value>testCache</value>
    </property>
    </bean>

    <bean id="methodCacheInterceptor" class="test.MethodCacheInterceptor">
    <property name="cache">
    <ref local="methodCache" />
    </property>
    </bean>


    <bean id="methodCachePointCut" class="org.springframework.aop.support.RegexpMetho dPointcutAdvisor">
    <property name="advice">
    <ref local="methodCacheInterceptor"/>
    </property>
    <property name="patterns">
    <list>
    <value>getFecha</value>
    </list>
    </property>
    </bean>

    <bean id="fecha" class="org.springframework.aop.framework.ProxyFact oryBean">
    <property name="target">
    <bean class="test.Fecha"/>
    </property>
    <property name="interceptorNames">
    <list>
    <value>methodCachePointCut</value>
    </list>
    </property>
    </bean>


    And this is the result I get:

    excepción

    javax.servlet.ServletException: Servlet.init() para servlet springxsltdispatcher lanzó excepción
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869)
    org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664)
    org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
    org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80)
    org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
    java.lang.Thread.run(Thread.java:595)


    causa raíz

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'xsltController' defined in ServletContext resource [/WEB-INF/springxsltdispatcher-servlet.xml]: Cannot resolve reference to bean 'fecha' while setting bean property 'fecha'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'fecha': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError
    org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:256)
    org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:128)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:950)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:740)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:417)
    org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 45)
    org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:140)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:242)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:156)
    org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:273)
    org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:346)
    org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:156)
    org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:3 08)
    org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:252 )
    org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:221)
    org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:115)
    javax.servlet.GenericServlet.init(GenericServlet.j ava:211)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869)
    org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664)
    org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
    org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80)
    org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
    java.lang.Thread.run(Thread.java:595)


    causa raíz

    java.lang.NoClassDefFoundError
    org.springframework.aop.framework.Cglib2AopProxy.c reateEnhancer(Cglib2AopProxy.java:227)
    org.springframework.aop.framework.Cglib2AopProxy.g etProxy(Cglib2AopProxy.java:154)
    org.springframework.aop.framework.ProxyFactoryBean .getProxy(ProxyFactoryBean.java:352)
    org.springframework.aop.framework.ProxyFactoryBean .getSingletonInstance(ProxyFactoryBean.java:304)
    org.springframework.aop.framework.ProxyFactoryBean .getObject(ProxyFactoryBean.java:253)
    org.springframework.beans.factory.support.Abstract BeanFactory.getObjectFromFactoryBean(AbstractBeanF actory.java:1175)
    org.springframework.beans.factory.support.Abstract BeanFactory.getObjectForBeanInstance(AbstractBeanF actory.java:1141)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:256)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:156)
    org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:248)
    org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:128)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:950)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:740)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:417)
    org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 45)
    org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:140)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:242)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:156)
    org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:273)
    org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:346)
    org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:156)
    org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:3 08)
    org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:252 )
    org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:221)
    org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:115)
    javax.servlet.GenericServlet.init(GenericServlet.j ava:211)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869)
    org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664)
    org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
    org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80)
    org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
    java.lang.Thread.run(Thread.java:595)





    Thank you,

    Óscar.
Working...
X