aspose file tools*
The moose likes Spring and the fly likes Spring 3.1-M1 Cacheable annotation with Ehcache configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring 3.1-M1 Cacheable annotation with Ehcache configuration" Watch "Spring 3.1-M1 Cacheable annotation with Ehcache configuration" New topic
Author

Spring 3.1-M1 Cacheable annotation with Ehcache configuration

Markus Olsson
Greenhorn

Joined: Nov 18, 2010
Posts: 12
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

Joined: Nov 18, 2010
Posts: 12
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.
 
Don't get me started about those stupid light bulbs.
 
subject: Spring 3.1-M1 Cacheable annotation with Ehcache configuration