• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring 3.1-M1 Cacheable annotation with Ehcache configuration

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic