This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring 3.1-M1 Cacheable annotation with Ehcache configuration

 
Markus Olsson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've done a simple example where I've tried to integrate Spring 3.1 Cacheable annotation together with Ehcache.

But I can't get it to work, I'm using a simple servlet that works just fine with mvc but when I'm using breakpoints the cache just doesnt work.

It manages to store the cache but the interceptor don't seem to pick it up. And even more strange when I asked a friend to test this the results varied from time to time. Some times it intercepted the cache, other times it ignore it. But I can't get it to intercept the cache even once.

I'm running this on glassfish 2.1.1.

I add all the code to the files in the example here, I wasnt allowed to upload rar files here so I couldnt.
If anyone wants it please let me know where I can upload or give me your email and I'll send it.

If spring 3.1 doesnt work with ehcache, how can I do it without ehcache and configure the lifetime of the caches and such?

Best Regards,
Markus



-------------------------------------------
-------------------------------------------



-------------------------------------------
-------------------------------------------
web.xml


-------------------------------------------
-------------------------------------------
spring-config.xml




-------------------------------------------
-------------------------------------------
testing-ehcache.xml




-------------------------------------------
-------------------------------------------
pom.xml


 
Markus Olsson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will mark this as resolved because I found the error.
The problem was that I didnt create the class in the spring context, nor by autowired or bean. And of course the spring context can create a cache interceptor if I make that mistake.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic