hazelcast配置文件v3.6的异常

时间:2016-02-22 19:47:05

标签: hazelcast

当我使用hazelcast配置文件(也在下面复制)时,我收到以下异常。我正在使用SBT来运行该项目。我拿出了地图名称,属性等,但我无法摆脱异常。我使用的是hazelcast v3.6。

hazelcast.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config/hazelcast-config-3.6.xsd"
           xmlns="http://www.hazelcast.com/schema/config"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <group>
        <name>dev</name>
        <password>dev-pass</password>
    </group>

<!--    <management-center enabled="false" update-interval="5">http://xxx.xxx.xxx.xxx:8080/mancenter</management-center>
-->
    <network>
        <port auto-increment="true" port-count="100">5701</port>
        <outbound-ports>
            <ports>0-5900</ports>
        </outbound-ports>
        <join>
            <multicast enabled="false">
                <!--<multicast-group>224.2.2.3</multicast-group>
                <multicast-port>54327</multicast-port>-->
            </multicast>
            <tcp-ip enabled="true">
                <member>192.168.120.134</member>
            </tcp-ip>
        </join>
        <interfaces enabled="true">
            <interface></interface>
        </interfaces>
        <ssl enabled="false" />
        <socket-interceptor enabled="false" />
        <symmetric-encryption enabled="false">
            <algorithm>PBEWithMD5AndDES</algorithm>
            <!-- salt value to use when generating the secret key -->
            <salt>thesalt</salt>
            <!-- pass phrase to use when generating the secret key -->
            <password>thepass</password>
            <!-- iteration count to use when generating the secret key -->
            <iteration-count>19</iteration-count>
        </symmetric-encryption>
    </network>

    <partition-group enabled="false"/>

    <executor-service name="default">
        <pool-size>16</pool-size>
        <!--Queue capacity. 0 means Integer.MAX_VALUE.-->
        <queue-capacity>0</queue-capacity>
    </executor-service>
    <!--
    <properties>
        <property name="hazelcast.logging.type">slf4j</property>
        <property name="db.name">test_service</property>
        <property name="db.username">test</property>
        <property name="db.password">test</property>
        <property name="db.hostname">localhost</property>
        <property name="db.port">3306</property>
    </properties>
-->
<!--
    <map name="testMap">
        <async-backup-count>1</async-backup-count>

        <near-cache>
            <max-size>5000</max-size>
            <invalidate-on-change>true</invalidate-on-change>
        </near-cache>

        <map-store enabled="false">
            <class-name>testservice.common.loadstores.TestLoadStore</class-name>
            <write-delay-seconds>0</write-delay-seconds>
        </map-store>
    </map>
    -->
<!--
    <serialization>
        <portable-version>0</portable-version>
        <serializers>

            <serializer type-class="testservice.common.data.beans.Test">testservice.common.serializers.TestSerializer</serializer>
            <serializer type-class="testservice.common.data.beans.Request">testservice.common.serializers.RequestSerializer</serializer>
            <serializer type-class="testservice.common.data.beans.User">testservice.common.serializers.UserSerializer</serializer>

        </serializers>
    </serialization>  -->

</hazelcast>

例外

[run-main-9] HazelcastAccessor ERROR - Exception while starting Hazelcast server:1
java.lang.ArrayIndexOutOfBoundsException: 1
    at com.hazelcast.config.AbstractXmlConfigHelper.schemaValidation(AbstractXmlConfigHelper.java:154) ~[hazelcast-all-3.6.jar:3.6]
    at com.hazelcast.config.XmlConfigBuilder.parseAndBuildConfig(XmlConfigBuilder.java:218) ~[hazelcast-all-3.6.jar:3.6]
    at com.hazelcast.config.XmlConfigBuilder.build(XmlConfigBuilder.java:201) ~[hazelcast-all-3.6.jar:3.6]
    at com.hazelcast.config.ClasspathXmlConfig.<init>(ClasspathXmlConfig.java:100) ~[hazelcast-all-3.6.jar:3.6]
    at com.hazelcast.config.ClasspathXmlConfig.<init>(ClasspathXmlConfig.java:57) ~[hazelcast-all-3.6.jar:3.6]
    at com.hazelcast.config.ClasspathXmlConfig.<init>(ClasspathXmlConfig.java:44) ~[hazelcast-all-3.6.jar:3.6]
    at com.latch.hazelcastserver.HazelcastAccessor.<init>(HazelcastAccessor.java:20) [classes/:na]
    at com.latch.hazelcastserver.HazelcastAccessor.<clinit>(HazelcastAccessor.java:12) [classes/:na]
    at com.latch.hazelcastserver.HazelcastServer.main(HazelcastServer.java:25) [classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_72]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_72]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_72]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_72]
    at sbt.Run.invokeMain(Run.scala:67) [run-0.13.9.jar:0.13.9]
    at sbt.Run.run0(Run.scala:61) [run-0.13.9.jar:0.13.9]
    at sbt.Run.sbt$Run$$execute$1(Run.scala:51) [run-0.13.9.jar:0.13.9]
    at sbt.Run$$anonfun$run$1.apply$mcV$sp(Run.scala:55) [run-0.13.9.jar:0.13.9]
    at sbt.Run$$anonfun$run$1.apply(Run.scala:55) [run-0.13.9.jar:0.13.9]
    at sbt.Run$$anonfun$run$1.apply(Run.scala:55) [run-0.13.9.jar:0.13.9]
    at sbt.Logger$$anon$4.apply(Logger.scala:85) [logging-0.13.9.jar:0.13.9]
    at sbt.TrapExit$App.run(TrapExit.scala:248) [run-0.13.9.jar:0.13.9]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72]

1 个答案:

答案 0 :(得分:3)

您的xsi:schemaLocation无效,必须是:

xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.6.xsd"

您没有http://www.hazelcast.com/schema/config