Hazelcast 3.1 configuration on Spring - Invalid content was found starting with element 'hz:partition-group'

485 views
Skip to first unread message

rodrigo

unread,
Dec 11, 2013, 9:30:13 PM12/11/13
to haze...@googlegroups.com
This is probably a silly error, but cannot find why it is happening. Basically, STS is complaining about the hz:partition-group tag with the error below:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'hz:partition-group'. One of '{"http://www.hazelcast.com/schema/spring":map, "http://www.hazelcast.com/schema/spring":multimap, "http://www.hazelcast.com/schema/spring":list, "http://www.hazelcast.com/schema/spring":set, "http://www.hazelcast.com/schema/spring":topic, "http://www.hazelcast.com/schema/spring":listeners, "http://www.hazelcast.com/schema/spring":serialization, "http://www.hazelcast.com/schema/spring":security}' is expected.

This is my application context dedicated to Hazelcast: (note, if I remove the partition-group tag, it works just fine. What am I doing wrong ?

Thanks!

<?xml version="1.0" encoding="UTF-8"?>
<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.2.xsd
        http://www.hazelcast.com/schema/spring
        http://www.hazelcast.com/schema/spring/hazelcast-spring-3.1.xsd">

    <hz:hazelcast id="hazelcast">
        <hz:config>
            <hz:group name="dev-user" password="dev-pass" />
            <hz:network port="7771" port-auto-increment="true">
                <hz:join>
                    <hz:multicast enabled="false" />
                    <hz:tcp-ip enabled="true">
                        <hz:member>127.0.0.1</hz:member>
                    </hz:tcp-ip>
                </hz:join>
            </hz:network>

            <hz:map name="msgMap" backup-count="1" async-backup-count="0"
                read-backup-data="true" eviction-policy="LRU" time-to-live-seconds="120"
                max-size="50" max-size-policy="USED_HEAP_PERCENTAGE">
            </hz:map>

            <hz:partition-group enabled="true" group-type="CUSTOM" />
   
        </hz:config>

    </hz:hazelcast>
</beans>

Peter Veentjer

unread,
Dec 12, 2013, 1:09:15 AM12/12/13
to haze...@googlegroups.com
My gut feeling says it has to do with the order; so try placing hz:partition-group a bit higher.


--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at http://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/54f402af-785d-46b9-a565-ee956a968eb8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Barry Lagerweij

unread,
Dec 12, 2013, 2:50:45 AM12/12/13
to haze...@googlegroups.com
<partition-group> should come *after* <network>. If you use an XML editor which supports schema validation (<shameless IntelliJ IDEA plug goes here>) you would have spotted the error.

(Although frankly I don't understand why hazelcast would use <xs:sequence> instead of <xs:choice maxOccurs="unbounded">, which would make the XML a bit more flexible with respect to order)

With kind regards,
Barry


--
Reply all
Reply to author
Forward
0 new messages