所以我使用 Hazelcast 创建服务器和客户端。结果我在尝试运行客户端时遇到以下异常。
WARNING: hz.client_0 [56086-56015-56176] [3.7.8] Exception during initial connection to /192.168.1.112:5706
com.hazelcast.client.AuthenticationException: Invalid credentials!
at com.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:530)
at com.hazelcast.client.connection.nio.ClientConnectionManagerImpl$2.onResponse(ClientConnectionManagerImpl.java:513)
at com.hazelcast.spi.impl.AbstractInvocationFuture$1.run(AbstractInvocationFuture.java:251)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)
at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92)
错误来自:
ClientConfig hzConfig = getHzConfig();
hz = HazelcastClient.newHazelcastClient(hzConfig);
获取频率配置:
private static ClientConfig getHzConfig() {
String addresses = Optional.ofNullable(System.getProperty("addresses")).orElseThrow(IllegalArgumentException::new);
String addressList[] = addresses.split(";");
ClientConfig clientConfig = new ClientConfig();
clientConfig.setGroupConfig(new GroupConfig("56086-56015-56176", "56086-56015-56176"));
ClientNetworkConfig networkConfig = clientConfig.getNetworkConfig();
for (String address : addressList) {
networkConfig.addAddress(address);
}
return clientConfig;
}
慕尼黑8549860
萧十郎
相关分类