【问题标题】:Upgrading Hazelcast from 2.5 to 3.1将 Hazelcast 从 2.5 升级到 3.1
【发布时间】:2014-04-01 10:25:46
【问题描述】:

我使用的是 Hazelcast 2.5。最近我们注意到我们的生产服务器上出现“明显的死锁”问题。我们发现升级到 Hazelcast 3.0 或更高版本可以解决问题。现在,当我尝试升级到 3.1 时,我在 ApplicationContext.xml 中收到以下错误,它不再识别命名空间“hz”。

升级到 3.1 之前的 applicationContext-hazelcast.xml 内容(删除了一些命名空间)

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:cache="http://www.springframework.org/schema/cache"
    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.1.xsd 
        http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
        http://www.hazelcast.com/schema/spring http://www.hazelcast.com/schema/spring/hazelcast-spring-2.5.xsd">

升级到 3.1 后的 applicationContext-hazelcast.xml 内容(删除了一些命名空间)

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:cache="http://www.springframework.org/schema/cache"
    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.1.xsd 
        http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
        http://www.hazelcast.com/schema/spring http://www.hazelcast.com/schema/spring/hazelcast-spring-3.1.xsd">

错误信息:

Multiple annotations found at this line:
    - schema_reference.4: Failed to read schema document 'http://www.hazelcast.com/schema/spring/hazelcast-spring-3.1.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>.
    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'hz:hazelcast'.

我该怎么做?

【问题讨论】:

    标签: hazelcast


    【解决方案1】:

    您说得对,下载 3.1 XSD 似乎有问题。当我尝试使用 hazelcast-spring-3.1 时收到 HTTP 403。

    Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.hazelcast.com/schema/spring/hazelcast-spring-3.1.xsd
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:637)
    at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:189)
    at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:582)
    at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:685)
    at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser.parse(SchemaDOMParser.java:530)
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2175)
    ... 31 more
    

    当我升级到使用 hazelcast-spring-3.2 时,一切都对我有用,我可以通过 Spring Bean 获得 Hazelcast 实例。您能否尝试升级到 3.2 并让我知道这是否适合您。同时,我将在 github.com/hazelcast 中针对 3.1 问题提出问题。

    【讨论】:

      猜你喜欢
      • 2014-08-07
      • 2017-12-03
      • 1970-01-01
      • 1970-01-01
      • 2013-02-05
      • 2022-07-22
      • 2012-12-12
      • 1970-01-01
      • 2013-11-14
      相关资源
      最近更新 更多