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.