【问题标题】:Infinispan local cache error: Unable to invoke method public void org.infinispan.globalstate.impl.GlobalConfigurationManagerImpl.start()Infinispan 本地缓存错误:无法调用方法 public void org.infinispan.globalstate.impl.GlobalConfigurationManagerImpl.start()
【发布时间】:2020-09-04 20:48:04
【问题描述】:

我已将 Spring 引导服务从 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】:

    要解决此问题,请删除本地缓存的空 &lt;transport /&gt; 元素。

    添加空元素似乎是config-converter 中的一个缺陷。有了空的transport 元素,Infinispan 似乎部分配置为集群同步。有关潜在问题的详细信息,请参阅错误报告:https://issues.redhat.com/browse/ISPN-11854

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-17
      • 2013-03-01
      • 2017-08-01
      • 2020-03-06
      • 2021-05-11
      • 2019-07-15
      相关资源
      最近更新 更多