You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HZ 3.7.1. I need to connect two separate HZ clients from a single Java app to the same HZ server (cluster). The first client connect successfully, but the second one cannot connect and fails with error:
Exception in thread "Thread-1" java.lang.IllegalStateException: Unable to connect to any address in the config! The following addresses were tried:[localhost/127.0.0.1:10000]
at com.hazelcast.client.spi.impl.ClusterListenerSupport.connectToCluster(ClusterListenerSupport.java:175)
at com.hazelcast.client.spi.impl.ClientClusterServiceImpl.start(ClientClusterServiceImpl.java:191)
at com.hazelcast.client.impl.HazelcastClientInstanceImpl.start(HazelcastClientInstanceImpl.java:379)
at com.hazelcast.client.HazelcastClientManager.newHazelcastClient(HazelcastClientManager.java:78)
at com.hazelcast.client.HazelcastClient.newHazelcastClient(HazelcastClient.java:72)
at com.bagri.xdm.cache.hazelcast.HzClientTest$ClientTest.run(HzClientTest.java:48)
at java.lang.Thread.run(Thread.java:745)
The very simple reproducer test is:
public class HzClientTest {
@Test
public void TwoClientsTest() throws Exception {
Config config = new Config();
config.getNetworkConfig().setPortAutoIncrement(true);
config.getGroupConfig().setName("schema");
config.getGroupConfig().setPassword("password");
JoinConfig join = config.getNetworkConfig().getJoin();
join.getMulticastConfig().setEnabled(false);
join.getTcpIpConfig().addMember("localhost:10000").setEnabled(true);
config.setProperty("hazelcast.logging.type", "slf4j");
HazelcastInstance server = Hazelcast.newHazelcastInstance(config);
new Thread(new ClientTest()).start();
Thread.sleep(1000);
//assertEquals(1, server.getClientService().getConnectedClients().size());
new Thread(new ClientTest()).start();
Thread.sleep(1000);
//assertEquals(2, server.getClientService().getConnectedClients().size());
Thread.sleep(5000);
}
private class ClientTest implements Runnable {
@Override
public void run() {
ClientConfig config = new ClientConfig();
config.getGroupConfig().setName("schema");
config.getGroupConfig().setPassword("password");
config.getNetworkConfig().addAddress("localhost:10000");
HazelcastInstance client = HazelcastClient.newHazelcastClient(config);
}
}
}
Please have a look. This functionality used to work in 3.6.x versions.
Thanks, Denis.
The text was updated successfully, but these errors were encountered:
HZ 3.7.1. I need to connect two separate HZ clients from a single Java app to the same HZ server (cluster). The first client connect successfully, but the second one cannot connect and fails with error:
The very simple reproducer test is:
Please have a look. This functionality used to work in 3.6.x versions.
Thanks, Denis.
The text was updated successfully, but these errors were encountered: