Results 1 to 5 of 5

Thread: Problems when setting a integer-value by PropertyPlaceholderConfigurer

  1. #1
    Join Date
    Nov 2011
    Posts
    5

    Default Problems when setting a integer-value by PropertyPlaceholderConfigurer

    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.maxidleseconds}" />
    I get this exception when i try to run it:

    Caused by: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '${hazelcast.maxidleseconds}' 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.

    Maybe somebody here know a solution?

    tia && regards noircc

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Actually your question is not for this forum since this forum is for Spring Integration project, but i'll answer it anyway.

    This looks like a bug in Hazelcust custom namespace implementation where i believe that in schema they have this attribute set as 'integer' datatype so you are actually getting SAX exception which has nothing to do with Spring.
    General pattern in Spring is to have all attributes to be of type 'string' thus allowing placeholders to be provided and than the resolution of the placeholder happens later in the lifecycle.
    I'd suggest to file a bug report in Hazelcust and attach this forum to it. We'll be more than glad to give them a few more pointers if they need.

  3. #3
    Join Date
    Nov 2011
    Posts
    5

    Default

    Thx for the quick answer. Mailed them, hopefully the guys at hazelcast will fix the bug.

  4. #4
    Join Date
    Apr 2012
    Posts
    1

    Default

    Hazelcast schema definitions have already been defining 'max-idle-seconds' as 'xs:string'

    http://hazelcast.com/schema/config/hazelcast-spring.xsd
    http://hazelcast.com/schema/spring/h...spring-2.0.xsd

  5. #5
    Join Date
    Nov 2011
    Posts
    5

    Default

    Yeah, i found out some minutes ago. I used an old version of hazelcast (1.9.4) , so i'll try to update my project.

    thx

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •