【发布时间】:2019-08-12 06:56:56
【问题描述】:
我正在尝试使用 Spring 配置 Hazelcast。 我正在为 Hazelcast 的 xml 文件配置使用单独的文件,我检查了我在 XML 中配置的 xsd,它包含“hazelcast”元素,还根据 xsd 中的命名空间规范进行了配置,还添加了 3.3 版本的 hazelcast、hazelcast-all 和 hazelcast -春天。
我检查了 xsd 文件 - http://www.hazelcast.com/schema/config hazelcast-config-3.3.xsd ,我可以打开并找到其中的 hazelcast 元素。
你可以在这里参考 hazlecast xml - https://dzone.com/articles/configuring-hazelcast-within
<hazelcast
xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.3.xsd"
xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<group>
<name>hazelcast</name>
<password>12345</password>
</group>
<properties>
<property name="hazelcast.logging.type">slf4j</property>
<property name="hazelcast.jmx">true</property>
<property name="hazelcast.jmx.detailed">true</property>
</properties>
<management-center enabled="false">http://localhost:8080/hazelcast</management-center>
<map name="HttpRequestsCache">
<time-to-live-seconds>600</time-to-live-seconds>
<max-size>1000</max-size>
</map>
</hazelcast>
但出现错误 -
在这一行找到多个注释: - 无法找到架构命名空间“http://www.hazelcast.com/”的元素“hazelcast”的 Spring NamespaceHandler 架构/配置' - cvc-elt.1:找不到元素“hazelcast”的声明。 - schema_reference.4:无法读取架构文档“hazelcast-config-3.3.xsd”,因为
1) 找不到文件; 2) 文件无法读取; 3) 文档的根元素不是。
【问题讨论】: