Marnee
Marnee

Reputation: 669

Infinispan local cache error: Unable to invoke method public void org.infinispan.globalstate.impl.GlobalConfigurationManagerImpl.start()

I have upgraded a Spring boot service to Infinispan 9.4.16.Final from 5.2.20.Final. The service has two XML files. I used the conversion script to convert them. Both have local-cache entries and no other types of caches. One was left with empty transport element by the conversion tool.

When we deploy and run these services, we often see this warning at startup:

org.infinispan.manager.EmbeddedCacheManagerStartupException: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.globalstate.impl.GlobalConfigurationManagerImpl.start() on object of type GlobalConfigurationManagerImpl

The above is the first warning/error we see. There is no stack trace. Why would it be calling GlobalConfigurationManagerImpl when we're only using local cache?

A few lines later in the log, then I see many The cache has been stopped and invocations are not allowed! errors. The last error we see is as follows. The service fails to start up successfully.

Caused by: org.infinispan.commons.CacheException: Initial state transfer timed out for cache org.infinispan.CONFIG on <server_name>

Why are these errors/warnings happening on startup? Is there a problem in the config files? I've searched online and have not found a solution.

~~More Info~~~

Here is one of the two XML config files:

<infinispan
   xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation = "urn:infinispan:config:9.4 http://www.infinispan.org/schemas/infinispan-config-9.4.xsd"
   xmlns = "urn:infinispan:config:9.4">

    <threads/>
    <cache-container name = "TestCenterServiceCache">
<!-- The conversion tool added this empty "transport" element. It was not present in our old config file -->
        <transport/>
        <jmx domain = "org.infinispan.TestCenterServiceCache"/>
        <local-cache name = "authorizedLocations">
            <expiration lifespan = "3600000"/>
        </local-cache>

        <!--caching for 24 hours: 3,600,000 milliseconds/hr x 24 hours -->
        <local-cache name = "proximitySearchConfiguration">
            <expiration lifespan = "86400000"/>
        </local-cache>
    </cache-container>
</infinispan>

The above is instantiated via applicationContext.xml. The first warning (GlobalConfigurationManagerImpl.start()) is referencing these beans.

<bean id="infinispanCacheManager"
          class="org.infinispan.spring.embedded.support.InfinispanEmbeddedCacheManagerFactoryBean"
          p:configurationFileLocation="classpath:testCenterServices-cache-config.xml" />

    <bean id="cacheManager"
          class="org.infinispan.spring.embedded.provider.SpringEmbeddedCacheManager">
        <constructor-arg ref="infinispanCacheManager" />
    </bean>

Here is the second XML config file:

<?xml version="1.0" ?>
<infinispan
   xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation = "urn:infinispan:config:9.4 http://www.infinispan.org/schemas/infinispan-config-9.4.xsd"
   xmlns = "urn:infinispan:config:9.4">

    <threads />
    <cache-container name="AtlasServicesCacheManager">
        <local-cache name="allLocaleCache" />
        <local-cache name="localeCacheByID" />

        <local-cache name="countryByCode" />
        <local-cache name="allActiveCountries" />
        <local-cache name="allCountries" />

        <local-cache name="allStatesForCountryCode" />
        <local-cache name="allActiveStatesForCountryCode" />
        <local-cache name="stateForCountryCodeStateCode" />
    </cache-container>
</infinispan>

The above is instantiated via java code.

    @Bean(name="atlasServicesCacheManager")
    public CacheManager makeCacheManager() throws IOException {
        return new SpringEmbeddedCacheManager(new DefaultCacheManager("atlas-cache-config.xml"));
    }

I don't know if it's meaningful, but only after the upgrade, we log messages that include "JGroups", such as Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration!.

The service instances are running on Windows Server 2012 R2 Standard (Windows 8).

Upvotes: 1

Views: 2235

Answers (1)

Marnee
Marnee

Reputation: 669

To fix this, remove the empty <transport /> element for local caches.

Adding that empty element seems to be a defect in the config-converter. With the empty transport element in place, it seems that Infinispan is partially configured for cluster synchronization. For details on the underlying issue, see bug report: https://issues.redhat.com/browse/ISPN-11854.

Upvotes: 1

Related Questions