Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Starting a cluster in gfsh like this:
gfsh> start locator gfsh> start server
And creating a GeodeConnectionConfig like this:
ClientCache clientCache = new ClientCacheFactory() .addPoolLocator("localhost", 10334) .create(); ConnectionConfig connectionConfig = new GeodeConnectionConfig(clientCache);
will result in the following exception on the client:
Exception in thread "main" java.lang.IllegalStateException: Unable to discover a locator that has ClusterManagementService running.Exception in thread "main" java.lang.IllegalStateException: Unable to discover a locator that has ClusterManagementService running. at org.apache.geode.management.internal.api.GeodeConnectionConfig.setClientCache(GeodeConnectionConfig.java:126) at org.apache.geode.management.internal.api.GeodeConnectionConfig.<init>(GeodeConnectionConfig.java:74) at example.v2.Experiment.main(Experiment.java:42)
And this exception in the locator logs:
java.lang.NullPointerExceptionjava.lang.NullPointerException at org.apache.geode.management.internal.configuration.handlers.ClusterManagementServiceInfoRequestHandler.processRequest(ClusterManagementServiceInfoRequestHandler.java:56) at org.apache.geode.distributed.internal.membership.gms.locator.PrimaryHandler.processRequest(PrimaryHandler.java:70) at org.apache.geode.distributed.internal.tcpserver.TcpServer.processOneConnection(TcpServer.java:421) at org.apache.geode.distributed.internal.tcpserver.TcpServer.lambda$processRequest$0(TcpServer.java:326) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
A workaround for this is to set "--bind-address=localhost" when starting the locator.
Despite this exception, the ClusterManagementService is running on the locator and the endpoints can still be accessed using hostname and port.