Spring 通过my hazelcastconfig中的PropertyPlaceHolderConfiger设置整数值时出现问题

Spring 通过my hazelcastconfig中的PropertyPlaceHolderConfiger设置整数值时出现问题,spring,properties,hazelcast,Spring,Properties,Hazelcast,我正在使用带有hazelcast的spring和spring的PropertyPlaceHolderConfigure将属性插入到SpringXML中,这些属性会随着环境的不同而变化 e、 g: 我想更改贴图的最大空闲秒数(对于每个环境都应该不同)。但这不起作用,因为它无法将其识别为整数: hz:map name="default" backup-count="2" max-size="0" max-idle-seconds="${hazelcast.maxidleseconds}" />

我正在使用带有hazelcast的spring和spring的PropertyPlaceHolderConfigure将属性插入到SpringXML中,这些属性会随着环境的不同而变化

e、 g:

我想更改贴图的最大空闲秒数(对于每个环境都应该不同)。但这不起作用,因为它无法将其识别为整数:

hz:map name="default" backup-count="2" max-size="0"
max-idle-seconds="${hazelcast.maxidleseconds}" />
我在尝试运行时遇到此异常:

Caused by: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '${hazelcast.maxidleseconds}' is not a valid value for 'integer'.
可能PropertyPlaceHolderConfigure无法插入整数。可能是与hazelcast.xsd相关的问题

也许这里有人知道解决办法

tia和问候 noircc

编辑:虽然Hazelcast集团提供了解决方案,但我在这里发布是为了提高知名度

这是一个以前解决过的老问题。升级到2.x版本并将xml配置头更新为:

<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:hz="http://www.hazelcast.com/schema/spring"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.hazelcast.com/schema/spring
            http://www.hazelcast.com/schema/spring/hazelcast-spring-2.0.xsd">

另外,有关详细信息,请参阅文档

编辑:虽然Hazelcast集团提供了解决方案,但我在这里发布是为了提高知名度

这是一个以前解决过的老问题。升级到2.x版本并将xml配置头更新为:

<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:hz="http://www.hazelcast.com/schema/spring"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.hazelcast.com/schema/spring
            http://www.hazelcast.com/schema/spring/hazelcast-spring-2.0.xsd">


另外,有关详细信息,请参阅文档。

您使用的是哪种版本的Spring an Hazelcast?嘿,我已经解决了。在版本1.9.4中,将所有内容更新为2.0.2(解决方案:)。不管怎样,你用的是什么版本的Hazelcast?嘿,我解决了。在版本1.9.4中,将所有内容更新为2.0.2(解决方案:)。无论如何,谢谢你的帮助!如果我得了15分,我会投更高的票。再说一遍:谢谢你的帮助!如果我得了15分,我会投更高的票。