0

Im using Apache Geode 1.14.4 and spring-data-geode version 2.7.2.

I have following Region config which fails to bring up my app.

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:gfe="http://www.springframework.org/schema/geode"
       xsi:schemaLocation="http://www.springframework.org/schema/geode http://www.springframework.org/schema/geode/spring-geode.xsd">
    <gfe:replicated-region id="regionId" cache-ref="myCacheRef">
        <!-- When region.get(k) is a cache-miss, this loader will be called to load the value (eg. from db) -->
        <gfe:cache-loader ref="myLoader"/>
        <gfe:cache-writer ref="myWriter"/>
        <!-- Time-to-live (TTL) is used for creation and put operations -->
        <gfe:entry-ttl timeout="300" action="DESTROY"/>
        <!-- Idle timeout (TTI) is used for get and netSearch operations -->
        <gfe:entry-tti timeout="300" action="DESTROY"/>
    </gfe:replicated-region>
</beans>

The exact error is:

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 29 in XML document from file [C:\Users\sjoshi\context\geode-context.xml] is invalid; 
nested exception is org.xml.sax.SAXParseException; lineNumber: 29; columnNumber: 56; cvc-complex-type.2.4.a: 
Invalid content was found starting with element '{"http://www.springframework.org/schema/geode":entry-ttl}'.
One of '{"http://www.springframework.org/schema/geode":membership-attributes, "http://www.springframework.org/schema/geode":gateway-sender, "http://www.springframework.org/schema/geode":gateway-sender-ref, "http://www.springframework.org/schema/geode":async-event-queue, "http://www.springframework.org/schema/geode":async-event-queue-ref, "http://www.springframework.org/schema/geode":subscription, "http://www.springframework.org/schema/geode":eviction, "http://www.springframework.org/schema/geode":lookup-region, "http://www.springframework.org/schema/geode":replicated-region, "http://www.springframework.org/schema/geode":partitioned-region, "http://www.springframework.org/schema/geode":local-region, "http://www.springframework.org/schema/geode":client-region}' is expected.
John Blum
  • 7,381
  • 1
  • 20
  • 30
Boss Man
  • 587
  • 2
  • 12

2 Answers2

1

The ordering of entry elements is not right. According to xsd it should be as following:

<beans xmlns="http://www.springframework.org/schema/beans"
              xmlns:gfe="http://www.springframework.org/schema/geode"
              xsi:schemaLocation="http://www.springframework.org/schema/geode 
                  http://www.springframework.org/schema/geode/spring-geode.xsd">

    <gfe:replicated-region id="regionId" cache-ref="myCacheRef">
        <gfe:entry-ttl timeout="300" action="DESTROY"/>
        <gfe:entry-tti timeout="300" action="DESTROY"/>
        <gfe:cache-loader ref="myLoader"/>
        <gfe:cache-writer ref="myWriter"/>
    </gfe:replicated-region>
</beans>
John Blum
  • 7,381
  • 1
  • 20
  • 30
Boss Man
  • 587
  • 2
  • 12
0

I provided detailed information to the problem you are experiencing in Spring Data for Apache Geode (SDG) Issue #616, the ticket you filed.

See my responses here, here and here.

John Blum
  • 7,381
  • 1
  • 20
  • 30