Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2232

Cache::re-start doesn't setup CommandInitializer in ComponentRegistry when used with Query

    XMLWordPrintable

Details

    Description

      When re-starting existing stopped cache, NPE is thrown:

      23:10:27,160 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host]] (http-/192.168.1.101:8080-2) Exception sending request initialized lifecycle event to listener instance of class org.jboss.capedwarf.appidentity.GAEListener: java.lang.NullPointerException
      at org.infinispan.query.impl.LifecycleManager.cacheStarted(LifecycleManager.java:125)
      at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:178) [infinispan-core-5.2.0.ALPHA2.jar:5.2.0.ALPHA2]
      at org.infinispan.CacheImpl.start(CacheImpl.java:523) [infinispan-core-5.2.0.ALPHA2.jar:5.2.0.ALPHA2]
      at org.infinispan.AbstractDelegatingCache.start(AbstractDelegatingCache.java:343) [infinispan-core-5.2.0.ALPHA2.jar:5.2.0.ALPHA2]
      at org.jboss.capedwarf.common.infinispan.InfinispanUtils.checkCache(InfinispanUtils.java:72) [capedwarf-common-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
      at org.jboss.capedwarf.common.infinispan.InfinispanUtils.getCache(InfinispanUtils.java:82) [capedwarf-common-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]

      This is the code I added:

      private static <K, V> Cache<K, V> checkCache(String cacheName) {
      final Cache<K, V> cache = cacheManager.getCache(cacheName, false);
      if (cache != null) {
      final ComponentStatus status = cache.getStatus();
      if (status != ComponentStatus.INITIALIZING && status != ComponentStatus.RUNNING)

      { cache.start(); }

      }
      return cache;
      }

      Attachments

        Activity

          People

            rh-ee-galder Galder ZamarreƱo
            ajustin@redhat.com Ales Justin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: