Don't know how to return count-value in Java

Basic question, why does next() not seem to give me the results back about the count of Entities?
2023-05-24 09:21:44,641 [INFO] [j.Test35_2_1.main] ::     [GraphStep(vertex,[]), HasStep([~label.eq(Entity)]), CountGlobalStep]
... 
Exception in thread "main" java.lang.IllegalStateException: org.apache.tinkerpop.gremlin.process.remote.RemoteConnectionException: org.apache.tinkerpop.gremlin.driver.exception.NoHostAvailableException: java.util.concurrent.CompletionException: Could not initialize 2 (minPoolSize) connections in pool. Successful connections=0. Closing the connection pool.
    at org.apache.tinkerpop.gremlin.process.remote.traversal.step.map.RemoteStep.promise(RemoteStep.java:97)
...
Caused by: org.apache.tinkerpop.gremlin.process.remote.RemoteConnectionException: org.apache.tinkerpop.gremlin.driver.exception.NoHostAvailableException: java.util.concurrent.CompletionException: Could not initialize 2 (minPoolSize) connections in pool. Successful connections=0. Closing the connection pool.
    at org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection.submitAsync(DriverRemoteConnection.java:231)

        logger.info(g.V().hasLabel("Entity").count());
        logger.info(g.V().hasLabel("Entity").count().next().toString());
Was this page helpful?