我有一个hazelcast服务器和客户端。客户端成功连接到其服务器。但是由于服务器需要重启时出现一些问题,客户端无法连接到服务器。 我在客户端的配置是
<network>
<cluster-members>
<address>127.0.0.1</address>
</cluster-members>
<smart-routing>true</smart-routing>
<redo-operation>true</redo-operation>
<connection-timeout>100000</connection-timeout>
<connection-attempt-limit>10</connection-attempt-limit>
<connection-pool-size>30</connection-pool-size>
</network>
我在客户端遇到的错误是
Hazelcast instance is not active!. Stacktrace follows:
com.hazelcast.core.HazelcastInstanceNotActiveException: Hazelcast instance is no
t active!
at com.hazelcast.client.HazelcastClientProxy.getClient(HazelcastClientPr
oxy.java:245)
at com.hazelcast.client.HazelcastClientProxy.getMap(HazelcastClientProxy
.java:95)
at com.hazelcast.web.WebFilter.getClusterMap(WebFilter.java:302)
at com.hazelcast.web.WebFilter.loadHazelcastSession(WebFilter.java:252)
at com.hazelcast.web.WebFilter.createNewSession(WebFilter.java:246)
at com.hazelcast.web.WebFilter.access$1100(WebFilter.java:59)
at com.hazelcast.web.WebFilter$RequestWrapper.getSession(WebFilter.java:
403)
at com.hazelcast.web.WebFilter$RequestWrapper.getSession(WebFilter.java:
314)
at com.k12report.security.AuthController$_closure4.doCall(AuthController
.groovy:40)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(Pag
eFragmentCachingFilter.java:198)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter
.java:63)
at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:694)
at com.hazelcast.web.WebFilter$RequestWrapper$1.forward(WebFilter.java:3
42)
at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:704)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:745)
[2014-07-10 21:22:18,929] - errors.GrailsExceptionResolver Unable to render erro
rs view: Hazelcast instance is not active!
com.hazelcast.core.HazelcastInstanceNotActiveException: Hazelcast instance is no
t active!
at com.hazelcast.client.HazelcastClientProxy.getClient(HazelcastClientPr
oxy.java:245)
at com.hazelcast.client.HazelcastClientProxy.getMap(HazelcastClientProxy
.java:95)
at com.hazelcast.web.WebFilter.getClusterMap(WebFilter.java:302)
at com.hazelcast.web.WebFilter.access$1000(WebFilter.java:59)
at com.hazelcast.web.WebFilter$HazelcastHttpSession.getAttribute(WebFilt
er.java:448)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(Pag
eFragmentCachingFilter.java:198)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter
.java:63)
at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:694)
at com.hazelcast.web.WebFilter$RequestWrapper$1.forward(WebFilter.java:3
42)
at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:704)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:745)
[2014-07-10 21:22:19,130] - [/frontend].[grails] Servlet.service() for servlet g
rails threw exception
com.hazelcast.core.HazelcastInstanceNotActiveException: Hazelcast instance is no
t active!
at com.hazelcast.client.HazelcastClientProxy.getClient(HazelcastClientPr
oxy.java:245)
at com.hazelcast.client.HazelcastClientProxy.getMap(HazelcastClientProxy
.java:95)
at com.hazelcast.web.WebFilter.getClusterMap(WebFilter.java:302)
at com.hazelcast.web.WebFilter.access$1000(WebFilter.java:59)
at com.hazelcast.web.WebFilter$HazelcastHttpSession.getAttribute(WebFilt
er.java:448)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(Pag
eFragmentCachingFilter.java:198)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter
.java:63)
at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:694)
at com.hazelcast.web.WebFilter$RequestWrapper$1.forward(WebFilter.java:3
42)
at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:704)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:745)
[2014-07-10 21:22:19,371] - [/frontend].[default] Servlet.service() for servlet
[default] in context with path [/frontend] threw exception [org.springframework.
web.util.NestedServletException: Request processing failed; nested exception is
org.codehaus.groovy.grails.exceptions.GrailsRuntimeException: com.hazelcast.core
.HazelcastInstanceNotActiveException: Hazelcast instance is not active!] with ro
ot cause
com.hazelcast.core.HazelcastInstanceNotActiveException: Hazelcast instance is no
t active!
at com.hazelcast.client.HazelcastClientProxy.getClient(HazelcastClientPr
oxy.java:245)
at com.hazelcast.client.HazelcastClientProxy.getMap(HazelcastClientProxy
.java:95)
at com.hazelcast.web.WebFilter.getClusterMap(WebFilter.java:302)
at com.hazelcast.web.WebFilter.access$1000(WebFilter.java:59)
at com.hazelcast.web.WebFilter$HazelcastHttpSession.getAttribute(WebFilt
er.java:448)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(Pag
eFragmentCachingFilter.java:198)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter
.java:63)
at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:694)
at com.hazelcast.web.WebFilter$RequestWrapper$1.forward(WebFilter.java:3
42)
at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:704)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:745)
服务器端没有任何错误。 感谢