[infinispan-dev] getting stopped cache

Galder Zamarreño galder at redhat.com
Tue Aug 28 04:44:18 EDT 2012


On Aug 27, 2012, at 10:51 PM, Ales Justin wrote:

> OK, let me try this workaround.
> 
> But should Cache::stop also remove it or not?

I'm not sure whether it should remove it or not. 

I remember working on the cache restart procedure and I have the feeling I might have avoided it to be removed from the cache manager to keep it registered in JMX (as stopped).

If I removed it completely, I was losing all references and losing the ability to restart it via JMX.

With time, I've come to the conclusion that this restarting is a bit of PITA. As with other start/stop services in the JDK, it's better to recreate after it's been stopped, rather than restarting the service.

Cheers,

> 
> If yes, I might dig deeper into finding the culprit,
> if not, then the workaround should do, I guess.
> 
> -Ales
> 
>> As a workaround, couldn't you check what the status of the cache is before using it? If it's stopped, you could call cache.start() again.
>> 
>> On Aug 25, 2012, at 3:44 PM, Ales Justin wrote:
>> 
>>> When running CapeDwarf tests these days I get this broken behavior:
>>> (using: Ispan 5.2.0.Alpha2)
>>> 
>>> On 1st test all works OK:
>>> * getting the X cache
>>> * passing it to SearchManager (from Ispan Query)
>>> * doing queries, etc
>>> * stopping the X cache on app (aka Arquillian test) undeploy
>>> 
>>> But when running 2nd app (more Arquillian tests) it breaks.
>>> 
>>> I'm again using X cache, via this lookup:
>>> (where toCacheName == X)
>>> 
>>>          final Cache<K, V> cache = cacheManager.getCache(toCacheName(config, appId), false);
>>>          if (cache != null)
>>>              return cache;
>>> 
>>> And I actually get some cache, where I would expect none.
>>> 
>>> Since this cache is not new, it's never run against Ispan Query's LifecycleManager,
>>> hence there is no QueryInterceptor in its component registry.
>>> 
>>> Which is where the app breaks: SearchManager requires QueryInterceptor in cache' component registry.
>>> 
>>> Shouldn't Cache::stop also remove the cache from EmbeddedCacheManager?
>>> btw: this used to work, dunno when it broke ...
>>> 
>>> Anyone else seeing something similar?
>>> 
>>> -Ales
>>> 
>>> ----------
>>> 
>>> 15:32:06,810 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host]] (http-/192.168.1.101:8080-3) Exception sending request initialized lifecycle event to listener instance of class org.jboss.capedwarf.appidentity.GAEListener: java.lang.IllegalArgumentException: Indexing was not enabled on this cache. class org.infinispan.query.backend.QueryInterceptor not found in registry
>>> 	at org.infinispan.query.impl.ComponentRegistryUtils.getComponent(ComponentRegistryUtils.java:40)
>>> 	at org.infinispan.query.SearchManagerImpl.<init>(SearchManagerImpl.java:57)
>>> 	at org.infinispan.query.Search.getSearchManager(Search.java:39)
>>> 	at org.jboss.capedwarf.datastore.AbstractDatastoreService.<init>(AbstractDatastoreService.java:61) [capedwarf-datastore-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
>>> 	at org.jboss.capedwarf.datastore.JBossDatastoreService.<init>(JBossDatastoreService.java:56) [capedwarf-datastore-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
>>> 	at com.google.appengine.api.datastore.DatastoreServiceFactory.getDatastoreService(DatastoreServiceFactory.java) [appengine-api-1.0-sdk-1.7.0.jar:]
>>> 	at org.jboss.capedwarf.log.JBossLogService.requestStarted(JBossLogService.java:215) [capedwarf-log-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
> 
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache




More information about the infinispan-dev mailing list