Thanks, Daniel.
Two questions, please :
- my project is a web based project with 2 dependencies : my service jar and my dao jar. My @Cacheable methods are in dao classes.
I have added 2 files :
1) an aop.xml file to the META-INF (META-INF from the same level as WEB-INF)
Code:
<!DOCTYPE aspectj PUBLIC"-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>
<weaver options="-verbose -showWeaveInfo">
<include within="com.mycompany.myproject.*"/>
</weaver>
</aspectj>
2) an application-config.xml to the WEB-INF
Code:
<?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:p="http://www.springframework.org/schema/p"
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">
<context:load-time-weaver aspectj-weaving="autodetect"/>
</beans>
- at my dao level (different jar) I added to my persistence-context.xml
Code:
<!-- Use @Cacheable,.. annotations for managing cache -->
<cache:annotation-driven mode="aspectj"/>
<!-- cache manager configuration -->
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cache-manager-ref="ehcache"/>
<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:config-location="/WEB-INF/ehcache.xml"/>
Does this look ok?
- I noticed "-verbose -showWeaveInfo" options. Where can I see the output,please?
Thank you.