2014-04-01 84 views
0

我使用的是Hazelcast 2.5。最近我們在我們的生產服務器上發現了「APPARENT DEADLOCK」問題。我們發現升級到Hazelcast 3.0或更高版本可以解決問題。現在,當我嘗試升級到3.1時,我在ApplicationContext.xml中遇到以下錯誤,它不再識別命名空間「hz」。升級到3.1之前將Hazelcast從2.5升級到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"> 

的applicationContext-hazelcast.xml內容升級到3.1後(去掉了一些命名空間)

<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'. 

我該怎麼做?

回答

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彈簧-3.2的一切對我的作品,我可以通過一個Spring bean獲得Hazelcast實例。你可以嘗試升級到3.2,並讓我知道如果這對你有用。與此同時,我將在github.com/hazelcast中爲3.1問題提出一個問題。