Problems when setting a integer-value by PropertyPlaceholderConfigurer using HazelcastSpring-Integration

436 views
Skip to first unread message

noir

unread,
Apr 11, 2012, 9:10:17 AM4/11/12
to Hazelcast
I am using spring with hazelcast and the PropertyPlaceholderConfigurer
of spring for inserting properties into the spring-xml which change by
different environment.

e.g.:

<hz:network port="${hazelcast.port}" port-auto-increment="true">
i'd like to change the max-idle-seconds of a map (should be different
for every environment). But this won't work because it doesn't
recognize it as an integer:

<hz:map name="default" backup-count="2" max-size="0"
max-idle-seconds="${hazelcast.max-idle-seconds}" />
I get this exception when i try to run it:

Caused by: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '$
{hazelcast.max-idle-seconds}' is not a valid value for 'integer'.
Maybe it's not possible for the PropertyPlaceholderConfigurer to
insert an integer. Maybe it's a problem related to the hazelcast.xsd.

I have already made a post at springforum[1]

If somebody knows a solution, plz answer me!

regards && tia
noircc


[1]http://forum.springsource.org/showthread.php?125279-Problems-when-
setting-a-integer-value-by-
PropertyPlaceholderConfigurer&p=408830#post408830

Mehmet Dogan

unread,
Apr 11, 2012, 9:15:39 AM4/11/12
to haze...@googlegroups.com
Which Hazelcast and XSD version are you using?

At the moment all hazelcast-spring.xsd's "max-idle-seconds" type is 'string' not 'integer'.


@mmdogan





--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To post to this group, send email to haze...@googlegroups.com.
To unsubscribe from this group, send email to hazelcast+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hazelcast?hl=en.


noir

unread,
Apr 11, 2012, 9:58:30 AM4/11/12
to Hazelcast
I am using 1.9.4 , i'll try to update to 2.0.2. Thx for the hint

noir

unread,
Apr 11, 2012, 10:24:53 AM4/11/12
to Hazelcast
I updated (hazelcast-2.0.2 , hazelcast-spring-2.0.2) , but now i get
another exception concerning schema-files in the header:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for
XML schema namespace [http://www.hazelcast.com/schema/config]

This is how i include the namespace:

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

This schema namespace of 1.9.4 should be the same as 2.0.2 according
to the spring-integration-document?

Mehmet Dogan

unread,
Apr 11, 2012, 10:46:11 AM4/11/12
to haze...@googlegroups.com

You are using 1.9 scheme. Please look at sample in 2.0 spring documentation ;

http://hazelcast.com/docs/2.0/manual/single_html/#SpringIntegration

http://hazelcast.com/schema/spring/hazelcast-spring-2.0.xsd is the correct xsd.

noir

unread,
Apr 11, 2012, 11:07:13 AM4/11/12
to Hazelcast
It worked! Thank you!!!

On Apr 11, 4:46 pm, Mehmet Dogan <meh...@hazelcast.com> wrote:
> You are using 1.9 scheme. Please look at sample in 2.0 spring documentation
> ;
>
> http://hazelcast.com/docs/2.0/manual/single_html/#SpringIntegration
>
> http://hazelcast.com/schema/spring/hazelcast-spring-2.0.xsdis the correct
Reply all
Reply to author
Forward
0 new messages