缓存条目未使用 [英] Cache entry not in use

查看:104
本文介绍了缓存条目未使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用以下技术的Web应用程序:JSF 2.0,EJB 3.1,JPA 2.0,JBoss AS 7.1 Final



有时我们从无处得到以下异常:

  09:46:29,664错误[org.jboss.ejb3.invocation](http-10.99.0.10-10.99.0.10 -8080-14)JBAS014134:组件上的EJB调用失败VehicleServiceBean方法public abstract java.util.List com.hji.common.service.VehicleService.findVehiclesBySearchCriteriaAndImporterIds(com.hji.common.domain.repository.VehicleRepository $ VehicleSearchCriteria,java。 lang.String,java.util.List,boolean):java.lang.IllegalStateException:JBAS014531:缓存条目{[36,-111,
-104,-128,61,-17,73,29, - 101,52,-7,-106,46,-3,44,-22]}没有使用
在org.jboss.as.ejb3.cache.impl.backing.NonPassivatingBackingCacheImpl.release(NonPassivatingBackingCacheImpl。 java:134)[jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
在org.jboss.as.ejb3.cache.impl.backing.NonPassivati ngBackingCacheImpl.release(NonPassivatingBackingCacheImpl.java:56)[jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
在org.jboss.as.ejb3.cache.spi.impl。 AbstractCache.release(AbstractCache.java:76)[jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
在org.jboss.as.ejb3.cache.spi.impl。 AbstractCache.release(AbstractCache.java:39)[jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
在org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor。 releaseInstance(StatefulSessionSynchronizationInterceptor.java:197)...
**导致:java.lang.IllegalStateException:JBAS014531:缓存条目{[36,-111,-104,-128,61,-17,73, 29,-101,52,-7,-106,46,-3,44,-22]}未使用**
在org.jboss.as.ejb3.cache.impl.backing.NonPassivatingBackingCacheImpl .release(NonPassivatingBackingCacheImpl.java:134)[jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
在org.jboss.as.ejb3.cache.impl.backing.NonPassivatingBackingCacheImpl .relea se(NonPassivatingBackingCacheImpl.java:56)[jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
在org.jboss.as.ejb3.cache.spi.impl.AbstractCache。 release(AbstractCache.java:76)[jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
在org.jboss.as.ejb3.cache.spi.impl.AbstractCache。 release(AbstractCache.java:39)[jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final] ...

我一直在网络搜索一段时间,但找不到任何解决方案。有人知道这种错误吗?

解决方案

我一直在寻找,因为我有类似的问题。我只发现了两个可能的解释:您的有状态bean已超时(在AS7.1上默认为5000秒),或者您将一个引用从一个线程传递给另一个线程(这被建议在 jboss论坛是不允许的,如果前者增加超时或捕获异常。如果是后者,jboss会将有状态的bean注入到需要的地方,而不是传递它。



我遇到的问题是它不是我的那个。我在测试设置中只有一个状态bean,它分别注入到各种无状态bean中 - 我可以在开始测试运行的几秒钟内生成异常,我仍然试图跟踪我在哪里出现错误 - 如果您已经找到了解决问题的其他解决方案,请发表。



Rgds,James



我已经缩小了并发访问 - 我可以做出大量顺序请求,但在此之前只有少数并发。 (我并发引号,因为我同步在@SessionScoped ejb所持有的锁,所以唯一可能的并发调用是我创建的getLock()方法)。



我完全不知道Weld是否允许或阻止对@SessionScoped @Stateful EJB的并发访问。我读到Seam将访问序列化(而Weld是从Seam出生的),但是不知道实际情况是否如此。如果是这样,那么其他的东西就是导致我的豆死了。尽管如此,通过单独的@Stateless bean的并发访问也很容易重现。


We have a web application using the following technologies: JSF 2.0, EJB 3.1, JPA 2.0, JBoss AS 7.1 Final

Sometimes we get the following exception out of nowhere:

09:46:29,664 ERROR [org.jboss.ejb3.invocation] (http-10.99.0.10-10.99.0.10-8080-14) JBAS014134: EJB Invocation failed on component VehicleServiceBean for method public abstract java.util.List com.hji.common.service.VehicleService.findVehiclesBySearchCriteriaAndImporterIds(com.hji.common.domain.repository.VehicleRepository$VehicleSearchCriteria,java.lang.String,java.util.List,boolean): java.lang.IllegalStateException: JBAS014531: Cache entry {[36, -111,
-104, -128, 61, -17, 73, 29, -101, 52, -7, -106, 46, -3, 44, -22]} is not in use
          at org.jboss.as.ejb3.cache.impl.backing.NonPassivatingBackingCacheImpl.release(NonPassivatingBackingCacheImpl.java:134) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
          at org.jboss.as.ejb3.cache.impl.backing.NonPassivatingBackingCacheImpl.release(NonPassivatingBackingCacheImpl.java:56) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
          at org.jboss.as.ejb3.cache.spi.impl.AbstractCache.release(AbstractCache.java:76) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
          at org.jboss.as.ejb3.cache.spi.impl.AbstractCache.release(AbstractCache.java:39) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
          at org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor.releaseInstance(StatefulSessionSynchronizationInterceptor.java:197) ...
**Caused by: java.lang.IllegalStateException: JBAS014531: Cache entry {[36, -111, -104, -128, 61, -17, 73, 29, -101, 52, -7, -106, 46, -3, 44, -22]} is not in use**
          at org.jboss.as.ejb3.cache.impl.backing.NonPassivatingBackingCacheImpl.release(NonPassivatingBackingCacheImpl.java:134) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
          at org.jboss.as.ejb3.cache.impl.backing.NonPassivatingBackingCacheImpl.release(NonPassivatingBackingCacheImpl.java:56) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
          at org.jboss.as.ejb3.cache.spi.impl.AbstractCache.release(AbstractCache.java:76) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
          at org.jboss.as.ejb3.cache.spi.impl.AbstractCache.release(AbstractCache.java:39) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final] ...

I have been searching the web for some time now but couldn't find any solution. Does anybody know this kind of error?

解决方案

I've been looking around as I've got a similar problem. I've only found two possible explanations: either your stateful bean has timed-out (defaults to 5000 seconds on AS7.1), or you're passing a reference to the SFSB from one thread to another - which (it is suggested on the jboss forum isn't allowed. If the former, either increase the timeout or catch the exception. If the latter, have jboss inject the stateful bean wherever it's needed rather than passing it around.

The problem I'm having is that it's not either of those for me. I only have one stateful bean in the test setup, which is injected separately into the various stateless beans - and I can generate the exception within a few seconds of starting the test run. I'm still trying to track-down where I'm going wrong - if you've found an alternative solution to your problem could you post it please?

Rgds, James

I've narrowed-it down to concurrent access - I can make lots of sequential requests, but only a few "concurrent" ones before this occurs. (I put concurrent in quotes because I am synchroising on a lock held by the @SessionScoped ejb so the only possible concurrent call is to the getLock() method I've created on it).

I'm totally confused over whether Weld allows or prevents concurrent access to @SessionScoped @Stateful EJBs. I read that that Seam serializes the access (and Weld is born out of Seam) but don't know whether that's actually the case. If it is, then something else is causing my bean to die. It's easily reproducable through concurrent access from separate @Stateless beans though.

这篇关于缓存条目未使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆