Infinispan本地缓存错误:无法调用方法public void org.infinispan.globalstate.impl.GlobalConfigurationManagerImpl.start()

问题描述 投票:0回答:1

我已经将Spring Boot服务从5.2.20.Final升级到了Infinispan 9.4.16.Final。该服务有两个XML文件。我使用了转换脚本来转换它们。两者都具有local-cache条目,并且没有其他类型的缓存。转换工具留给一个空的transport元素。

[当我们部署和运行这些服务时,我们经常在启动时看到此警告:

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

以上是我们看到的第一个警告/错误。没有堆栈跟踪。当我们仅使用本地缓存时,为什么会调用GlobalConfigurationManagerImpl?

[稍后在日志中几行,然后我看到许多The cache has been stopped and invocations are not allowed!错误。我们看到的最后一个错误如下。该服务无法成功启动。

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

为什么这些错误/警告在启动时发生?配置文件中有问题吗?我已经在线搜索,但没有找到解决方案。

~~ 更多信息 ~~~

这里是两个XML配置文件之一:

<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>

以上是通过applicationContext.xml实例化的。第一个警告(GlobalConfigurationManagerImpl.start())引用了这些bean。

<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>

这是第二个XML配置文件:

<?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>

上面是通过Java代码实例化的。

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

我不知道它是否有意义,但是只有在升级之后,我们才会记录包含“ JGroups”的消息,例如Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration!

服务实例在Windows Server 2012 R2 Standard(Windows 8)上运行。

infinispan
1个回答
0
投票

要解决此问题,请删除用于本地缓存的空<transport />元素。

添加空元素似乎是config-converter中的缺陷。在空的transport元素到位的情况下,似乎Infinispan已部分配置用于集群同步。有关潜在问题的详细信息,请参见错误报告:https://issues.redhat.com/browse/ISPN-11854

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.