Announcement Announcement Module
No announcement yet.
Problems when setting a integer-value by PropertyPlaceholderConfigurer Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.


    <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
    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
      Thx for the quick answer. Mailed them, hopefully the guys at hazelcast will fix the bug.


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


        • #5
          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.