本文介绍了将Infinispan xml配置从6.x迁移到7.x的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Infinispan 6.x,并且有几个XML配置文件.现在我想迁移到7.x,但是当新版本尝试解析旧的配置文件时出现异常.这是我的配置文件:

I've been using Infinispan 6.x and I have a couple of XML configuration files. Now I want to migrate to 7.x, but I'm having exceptions when the new version tries to parse the old configuration files. Here is my configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd">
  <global>
    <globalJmxStatistics enabled="false" mBeanServerLookup="dz.lab.cache.infinispan.DummyMBeanServer$DummyLoockup" />
  </global>
  <default>
    <eviction strategy="NONE" />
    <expiration lifespan="-1" maxIdle="-1" />
    <clustering mode="local">
      <hash>
        <groups enabled="true" />
      </hash>
    </clustering>
    <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup" transactionMode="TRANSACTIONAL" lockingMode="OPTIMISTIC" />
    <invocationBatching enabled="true" />
    <locking supportsConcurrentUpdates="true" />
  </default>
</infinispan>

和完整的堆栈跟踪:

org.infinispan.commons.CacheConfigurationException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[7,11]
Message: Unexpected element 'global' encountered
    at org.infinispan.configuration.parsing.ParseUtils.unexpectedElement(ParseUtils.java:35)
    at org.infinispan.configuration.parsing.Parser70.readElement(Parser70.java:96)
    at org.infinispan.configuration.parsing.ParserRegistry.parseElement(ParserRegistry.java:133)
    at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:115)
    at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:102)
    at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:89)
    ... 30 more

如何迁移此配置?我在官方用户指南中找不到提示.

How do I migrate this configuration? I can't find hints on the official user guide.

推荐答案

您的配置应如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<infinispan
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:infinispan:config:7.0 http://www.infinispan.org/schemas/infinispan-config-7.0.xsd"
        xmlns="urn:infinispan:config:7.0">
    <cache-container name="default" default-cache="defaultCache">
        <serialization />
        <jmx>
            <property name="enabled">true</property>
        </jmx>
        <local-cache name="defaultCache">
          ...
        </local-cache>
    </cache-container>
</infinispan>

查看所有事务,隔离,收回等元素的架构-它们非常相似.

See the schema for all the transaction, isolation, eviction etc. elements - those are very similar.

这篇关于将Infinispan xml配置从6.x迁移到7.x的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 20:26