此文件在8个月内没有更改,今天我们在与以下内容有关的hz:client属性上遇到了错误:
Multiple annotations found at this line:
- cvc-complex-type.2.4.c: The matching wildcard is strict,
but no declaration can be found for element 'hz:client'.
- schema_reference.4: Failed to read schema document
'https://hazelcast.com/schema/spring/hazelcast-spring-3.7.xsd',
because 1) could not find the document; 2) the document could
not be read; 3) the root element of the document is not
<xsd:schema>.
当我检查此https://hazelcast.com/schema/spring/hazelcast-spring-3.7.xsd模式是否存在,但其中的元素以xs标签开头时。 我该怎么做才能解决此问题或重写客户端配置?
<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.hazelcast.com/schema/spring https://hazelcast.com/schema/spring/hazelcast-spring-3.6.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-interation-2.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<bean id="test" class="org.test.impl.TestImpl">
<property name="hazelcastInstance" ref="hazelcastClient" />
</bean>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>file:///home/hazelcast.properties</value>
</list>
</property>
</bean>
<hz:client id="hazelcastClient">
<hz:group name="${hazelcast.server.user}" password="${hazelcast.server.password}"/>
<hz:network connection-attempt-limit="1000"
connection-attempt-period="3000"
connection-timeout="1000"
redo-operation="true"
smart-routing="true">
<hz:member>${hazelcast.server.url}:${hazelcast.server.port}</hz:member>
</hz:network>
</hz:client>
</beans>
答案 0 :(得分:1)
我用这个更改了架构:
<?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"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.hazelcast.com/schema/spring http://www.hazelcast.com/schema/spring/hazelcast-spring-3.7.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
现在正在工作,但我仍然不知道为什么。有人可以解释我吗?