Patrick Johnsn created GEODE-8005:
-------------------------------------

             Summary: NPE on locator when connecting to 
ClusterManagementService using a cache.
                 Key: GEODE-8005
                 URL: https://issues.apache.org/jira/browse/GEODE-8005
             Project: Geode
          Issue Type: Bug
          Components: gfsh, management
            Reporter: Patrick Johnsn


Starting a cluster in gfsh like this:
{code:java}
gfsh> start locator
gfsh> start server{code}
And creating a GeodeConnectionConfig like this:
{code:java}
 ClientCache clientCache = new ClientCacheFactory()
 .addPoolLocator("localhost", 10334)
 .create();

ConnectionConfig connectionConfig = new 
GeodeConnectionConfig(clientCache);{code}
will result in the following exception on the client:
{code:java}
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) {code}
 And this exception in the locator logs: 
{code:java}
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) {code}
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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to