首页 文章

使用带有Spring Annotations的ehcache 3(不使用Spring Boot)

提问于
浏览
12

我试图让Ehcache 3在不使用Spring引导的情况下使用Spring 4 .

Here is a working example out there which uses Spring Boot,但我正在处理一个没有使用Spring Boot的现有应用程序 .

问题是spring-context-support(添加Spring的缓存注释)要求Ehcache的CacheManager在这个类路径上:net.sf.ehcache.CacheManager

但是,在Ehcache 3中,CacheManager类驻留在另一个类路径上:org.ehcache.CacheManager .

所以,基本上spring-context-support不支持Ehcache 3.你必须直接使用JSR-107注释,而不是Spring提供的注释 .

但显然它适用于Spring Boot . 也许有一种方法可以使它与标准的Spring应用程序一起工作 . 这就是我所希望的 . 我真的想要使用Spring自己的注释而不是JSR-107注释 .

2 回答

相关问题