-
3 votesanswersviews
Spring Cacheable实现类
我试图以某种方式'调试'我使用spring boot cache注释的应用程序,为此我想知道如何找到实际实现Cacheable,CacheConfig等接口的类 . 我的想法是确认缓存正在填充,清空等 . 非常感谢你的帮助, -
1 votesanswersviews
缓存不起作用 - Ehcache Spring注释
我是Ehcache的新手 . 我尝试了一个Spring和Ehcache的例子 . 缓存似乎不起作用 . 当我尝试调试时,服务层返回对象但它没有被缓存 . 缓存中的键为空 . 以下是我的代码: web.xml中 <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class&g... -
0 votesanswersviews
Spring Cache Abstraction和Ehcache的问题
我面临一个问题,其中代码尝试查找名为“AdministrationContactManagerImpl.retrieve”的缓存,但无法找到它 . 目标方法使用@cacheable注释 . @Cacheable(value="administrationContactManagerImpl.retrieve", key="#prefix + #contract + #... -
6 votesanswersviews
Spring Boot,使用EhCache进行缓存
我需要在我的应用程序中缓存一些数据,我正在考虑使用Ehcache . 我有几个问题: 我需要另一台Ehcache服务器吗? 我需要另一个客户端与Ehcache合作吗? Ehcache如何处理多个实例?甚至可以使用Ehcache创建共享缓存之类的东西吗? -
1 votesanswersviews
ehcache xml需要defaultCache元素,而其他缓存正在获取defaultCache属性
这就是我的ehcache.xml的样子: <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false" name="defa... -
1 votesanswersviews
@Cachebale没有使用Ehcache和spring MVC Ehcache没有使用Spring Caching Annotation
我的应用程序是Spring MVC应用程序 . 尝试使用基于Spring Annotation的缓存 . 但它不起作用 . 请参考下面的代码 1. pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001... -
1 votesanswersviews
@cacheable of com.googlecode.ehcache.annotations.Cacheable不能使用spring
我是ehcache和spring注释集成的新手 . 我使用 com.googlecode.ehcache.annotations.Cacheable 注释如下 spring 2.5 并且它永远不会缓存返回值 . cache.getKeys() 返回一个空列表,每次控制器进行调用时都会调用该方法 . 请帮帮我 . 以下方法是一个接口的实现,控制器将根据映射的请求调用jsp URL.cacheI... -
0 votesanswersviews
正确注释ehcache和spring
我有一个这样的Model对象 - class ProductDTO { int id; String code; String description; //getters and setters go here } 我试图在一个像这样的代码的Web服务中使用带有ehcache的Spring 4 - class ProductServiceImpl implem... -
2 votesanswersviews
Spring数据(JPARepository)Ehcache二级缓存
有没有人使用Spring数据和Ehcache二级缓存?我在正确配置时遇到问题 . JPA属性: <prop key="hibernate.cache.provider_class">org.hibernate.cache.SingletonEhCacheProvider</prop> <prop key="hibe... -
0 votesanswersviews
Spring MVC LightAdmin配置
我'm trying to setup LightAdmin page for my web application, I' m跟随https://github.com/la-team/light-admin . 执行此步骤后,请看到此错误: 14:36:55.705 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactor... -
0 votesanswersviews
Eh缓存在Spring启动时的到期时间
我已经创建了一个spring boot应用程序并在maven项目中实现了EhCache . 我的EhCache的xml配置文件如下: <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" up... -
1 votesanswersviews
带有ehcache的Spring 3.1 @Cacheable不起作用
我的带有Spring和ehcache的@Cacheable不起作用,没有数据放在缓存上 . 当应用程序调用可缓存方法getFolProfile时,数据库始终是调用而不是缓存 . 请问,我可以告诉我我的代码中有什么问题 . 我的root-context.xml: <cache:annotation-driven proxy-target-class="true"/> ... -
1 votesanswersviews
使用@Cacheable的Spring缓存不能在启动时使用@PostConstruct
我正在使用Spring,我想在启动应用程序之前缓存一些数据 . 我在其他帖子中找到了一些解决方案来使用@PostConstruct来调用我的@Service方法(注释为@Cacheable),例如 . How to load @Cache on startup in spring?我这样做但是在应用程序启动后我调用REST endpoints 再次调用此服务方法它's sending datab... -
0 votesanswersviews
@Cacheable()没有返回正确的缓存
我很清楚这个主题有很多问题,但我无法理解它 . 问题似乎是 @CachePut 没有将新值添加到@Cacheable列表中 . 调试问题后我发现问题 seems 在关键 . 这是代码片段 @CacheConfig(cacheNames = "documents") interface DocumentRepository { @CachePut(key = "#a0... -
44 votesanswersviews
如何告诉Spring缓存不要在@Cacheable注释中缓存空值
有没有办法指定如果方法返回null值,那么不要将结果缓存在这样的方法的@Cacheable注释中? @Cacheable(value="defaultCache", key="#pk") public Person findPerson(int pk) { return getSession.getPerson(pk); } 更新:这是去年11月提交... -
0 votesanswersviews
带过滤器的Spring @Cacheable
每个实体类都有user.id值,我对所有服务都有过滤器,这些服务通过principal.id和实体user.id过滤数据,只需添加where子句 . 我开始使用@Cacheable spring选项 . 但过滤器不适用于spring-cache . 如何从缓存中过滤数据? @Override @Cacheable(value = "countries") public List... -
0 votesanswersviews
使用@Cacheable的方法在Spring中没有按预期工作
我试图将List缓存在一个类中,如下所示: Class Person{ @Autowired PersonService personService; . . . . @Cacheable("allStrings") public List<Strings> getAllStri... -
11 votesanswersviews
我应该如何在ehCache中使用@CachePut和@CacheEvict注释(ehCache 2.4.4,Spring 3.1.1)
我尝试了一些新的Spring功能,我发现@CachePut和@CacheEvict注释没有任何效果 . 可能是我做错了什么 . 你可以帮帮我吗? 我的applicationContext.xml . <cache:annotation-driven /> <!--also tried this--> <!--<ehcache:annotation-driven... -
0 votesanswersviews
ehcache理论查询 . 我有一个小的web应用程序 . 我们没有初始嵌入ehcache . 但是最近有要求
我有一个小的web应用程序 . 我们没有初始嵌入ehcache . 但最近有要求在应用程序中实现ehcache . 虽然我是ehcache新手仍然配置我的应用程序 . 有一些问题请尝试回答这个问题 . 哪种方法可以更好地注释类a)DAO b)服务(我已经在DAO中实现了? @Cacheable,@ CacheEvict @cacheput上面的注释我们需要专注于我的crud查询.. 我... -
0 votesanswersviews
Cacheput注释不更新缓存Hazelcast缓存
我正在Spring Boot中开发一个java应用程序 . 我使用Hazelcast进行缓存,但是当使用@CachePut注释方法时它不会更新缓存我的代码如下所示: @CachePut(cacheNames = "cachetest") public void addData(com.nikesh.webapp.model.CacheTest cacheObj) { r... -
2 votesanswersviews
@Cacheable注释的值和cacheName参数之间的差异
我是@Cacheable和@CacheEvict注释的新手,我们在Spring框架中用于缓存 . 但在研究@Cacheable使用 what is the difference between value and cacheName params of @Cacheable annotation 的实现和参数时? -
0 votesanswersviews
缓存构建后,Spring引导缓存逐出
我们使用@Cacheable和@CacheEvict进行缓存实现 . 问题是,构建缓存需要3分钟以上 . 根据应用程序逻辑,首先清除缓存然后创建 . 在任何用户访问我们的应用程序之间,应用程序无法在缓存仍在构建时发送数据 . 是否有任何 spring 方式首先构建缓存,然后用新缓存替换旧缓存(除了@CachePut) . 谢谢,Srikanth . -
3 votesanswersviews
使用AspectJ的新手:无法调用方面
所以,当我的域中对象的状态发生变化时,我开始考虑使用AspectJ来处理处理事件 . 实际上,我想写一些包含我域中所有setter方法的建议 . 调用通知时,它将检查所设置字段的初始值,运行setter,然后在setter执行后检查该值 . 如果值发生更改,它将向事件侦听器触发事件,通知更改 . 我使用了这里找到的教程:http://www.andrewewhite.net/wordpress/2... -
5 votesanswersviews
带有spring cache和aspectj的NoClassDefFoundError
我在 Spring 季webapp( Spring 季3.1)中收到此错误,我不知道为什么 . org.springframework.web.util.NestedServletException:处理程序处理失败;嵌套异常是java.lang.NoClassDefFoundError:mypackage / TestCache $ AjcClosure1 ( $AjcClosure1 很奇... -
2 votesanswersviews
spring 缓存和aspectj
我想对不受spring管理的对象使用@cacheable注释 . 我正在使用maven-aspectj编译器来编译类 . 但我没有看到任何编织 . 我没有@ Aspect,因为我假设spring应该为所有缓存相关的注释处理这个问题 . 我的配置文件中有以下内容 . 谷歌搜索后我做了几个改变 <cache:annotation-driven mode="aspectj"/&... -
1 votesanswersviews
在Spring项目中使用AspectJ拦截MongoDB调用
我正在使用Spring和MongoDB java驱动程序,我试图拦截mongo DBCursor对象上的所有调用,以便在执行之前查看查询 . 我一直在尝试使用aspject-maven-plugin进行外部jar . http://mojo.codehaus.org/aspectj-maven-plugin/weaveJars.html <plugin> <groupId... -
0 votesanswersviews
maven aspectj插件可以通过注释编写方面吗?
我有一个项目,我想使用方面但不使用 spring . 所以我使用的是AspectJ . 在我的特定情况下,LTW不适合我,所以我必须使用CTW,这导致我使用maven aspectj插件 . 我目前正在使用Java 7.我正在编写一个在一个maven模块中编写的方面到另一个模块中,它将它作为依赖项 . 当我编织一个非注释的方面时,插件似乎正确编织,但当我将其切换到基于注释的方面时,似乎插件不是在... -
0 votesanswersviews
java.lang.NoClassDefFoundError:org / aspectj / lang / annotation /周围当karaf和spring aspectj
我开发了驼峰osgi捆绑,它使用spring style camel配置和aspectj aop功能 . 当我将它部署到karaf 3.0.1中时,它会给出java.lang.NoClassDefFoundError:org / aspectj / lang / annotation / Around异常 . 我的pom.xml中有以下依赖项 <dependency> <gr... -
12 votesanswersviews
Aspect不适用于带有外部jar的Spring启动应用程序
我正在尝试为测量方法运行时创建一个计时器方面 . 我创建了一个名为 @Timer 的注释: @Retention(RetentionPolicy.RUNTIME) @Target(value = {ElementType.METHOD, ElementType.TYPE}) public @interface Timer { String value(); } 然后我创建了如下方面: @... -
1 votesanswersviews
缓慢的ehcache spring 注释
我在Spring 3.0.2中使用了ehcache-spring-annotations 1.2.0(谷歌代码) . 我用@Cacheable注释了一个DAO方法 . 实际上进行了缓存(使用logging和ehCache mbean进行验证) . 但是,当存在高速缓存命中时,该方法仍需要50ms到100ms才能执行 . 起初,我怀疑还在创建一个Hibernate事务,因此我创建了一个使用@Cach...