-
1. Re: Cache eviction & expiration config has no effect on 7.1.0.CR1b
alesj Jan 3, 2012 6:35 AM (in response to rbertoncelj)I've stumbled upon this as well, and this are my findings.
JNDI lookup is broken wrt cache-config service.
e.g. if you lookup cache container via JNDI (as I do), and then grab some cache from it,
cache-config service is never started, hence custom config is never registered against container -- you get default.
So, imo, the only way to get cache in proper state/config is via MSC,
which refs CacheService, which depends on cache-config service.
Which is kinda hard from "static" (non-JBoss AS7/MSC integrated) usecase.
Just my 0.02$, as I spent the evening finding why my cache is not indexable. :-)
This describes how AS7' Infinispan sub-system handles things - container and its cache configs are 2 diff MSC services.
Unless you access that cache via MSC, its config will never get applied to container, hence you end-up with default config.
Workaround is to somehow trigger that Cache-config service to start -- who's purpose is to register the config against container.
* https://github.com/alesj/jboss-as/commit/cf96f588aaa94d864f459e4dc5e277dab81eb170#diff-2
(since you're doing that from the app, not another sub-system as this code, try ServiceActivator pattern from MSC integration)
-
2. Re: Cache eviction & expiration config has no effect on 7.1.0.CR1b
ctomc Jan 3, 2012 8:26 AM (in response to alesj)Ales,
I don't know if this is the case here, your problem was when trying to do JNDI lookup of the cache, but if you do it trough @Resource it should work.
Problem is similar but not the same, as this is application and you ware in subsystem of as where you cannot get to many of resources that application has on disposial.
I will try to reproduce and debug this.
-
3. Re: Cache eviction & expiration config has no effect on 7.1.0.CR1b
alesj Jan 3, 2012 7:25 PM (in response to ctomc)Ales,
I don't know if this is the case here, your problem was when trying to do JNDI lookup of the cache, but if you do it trough @Resource it should work.
Problem is similar but not the same, as this is application and you ware in subsystem of as where you cannot get to many of resources that application has on disposial.
That was a different issue. ;-)
* it was not even finding container jndi binding, since I'm doing a programmatic lookup, w/o metadata
** it was fixed by adding proper metadata during deployment processing; similar to what is produced from @Resource
This one is about cache-config, which is not properly appiled.
Put a break point into cache-config service' start and you'll see it never gets invoked, hence it's never registered against container.
-
5. Re: Cache eviction & expiration config has no effect on 7.1.0.CR1b
alesj Jan 4, 2012 10:08 AM (in response to pferraro)FYI:
Is there a way to make non-metadata described JNDI lookup start on_demand service?
Atm this is not the case, as deep down in some Naming service, you simply do a ServiceContainer lookup via name.
The service is there, but it's not started yet -- that error msg I sent you before NY.
"Error looking up infinispan/capedwarf, service service jboss.naming.context.java.jboss.infinispan.capedwarf is not started"
I guess this is a MSC thing, and we need to check how it enables on_demand services.
(it already does that properly if you do have the right metadata; e.g. @Resouorce)
Just asking since I know we had that for MC -- as I wrote it. :-)
* we fully installed a service/bean if it was on_demand
-
6. Re: Cache eviction & expiration config has no effect on 7.1.0.CR1b
shant Mar 22, 2012 8:49 PM (in response to rbertoncelj)I face same problem, the eviction that is set in the standalone.xml does not work.. Could you resolve this problem?
Also, are there any examples that you know of that give more information on eviction in jboss AS 7.1.0.
Thank you.
-
7. Re: Cache eviction & expiration config has no effect on 7.1.0.CR1b
pferraro Mar 24, 2012 9:59 AM (in response to shant)The issue addressed in the thread *should* already be fixed. Cache configururation services are installed as passive, such that when the cache manager is referenced, all caches defined by the subsystem will already be registered with the cache manager.
Can you post your eviction configuration and the evidence you have that it isn't working?
-
8. Re: Cache eviction & expiration config has no effect on 7.1.0.CR1b
shant Mar 27, 2012 2:18 PM (in response to pferraro)I see that the evictionmanager is running, when I switch the infinispan to "TRACE" mode.
But, I am adding String to the cache using one thread , and removing the object using another thread. But I see that even after adding 20 strings to the cache , when i remove the first string, it is still there in the cache. The configuration I am using is :
<cache-container name="localCacheCont" default-cache="localCache" jndi-name="java:jboss/infinispan/container/localCacheCont">
<local-cache name="localCache" jndi-name="java:jboss/infinispan/cache/localCacheCont/localCache">
<eviction strategy="LRU" max-entries="5"/>
<expiration max-idle="10"/>
</local-cache>
</cache-container>
May be I am missing something, Is there anything wrong in the above configuration.thanks
-
9. Re: Cache eviction & expiration config has no effect on 7.1.0.CR1b
lucianob May 24, 2012 5:41 AM (in response to alesj)Ales Justin ha scritto:
FYI:
Is there a way to make non-metadata described JNDI lookup start on_demand service?
Atm this is not the case, as deep down in some Naming service, you simply do a ServiceContainer lookup via name.
The service is there, but it's not started yet -- that error msg I sent you before NY.
"Error looking up infinispan/capedwarf, service service jboss.naming.context.java.jboss.infinispan.capedwarf is not started"
I guess this is a MSC thing, and we need to check how it enables on_demand services.
(it already does that properly if you do have the right metadata; e.g. @Resouorce)
Just asking since I know we had that for MC -- as I wrote it. :-)
* we fully installed a service/bean if it was on_demand
Hi Ales,
I faced the same exception (service not started), and I resolved with the start="EAGER" attribute in cache tag, after having read https://docs.jboss.org/author/display/ISPN/Getting+Started+Guide+-+JBoss+AS+7 , Cache container lifecycle paragraph.
JBoss 7.1.1.Final, Infinispan 5.1.2.FINAL
Bye
LB
-
10. Re: Cache eviction & expiration config has no effect on 7.1.0.CR1b
georgespurlock Jun 19, 2015 3:06 AM (in response to rbertoncelj)I had problem with this sub-system service