IllegalStateException : Gremlin Server must be configured to use the JanusGraphManager

前端 未结 1 1152
孤独总比滥情好
孤独总比滥情好 2021-01-28 00:58
Set graphNames = JanusGraphFactory.getGraphNames();
for(String name:graphNames) {
    System.out.println(name);
}

The above snippet produ

1条回答
  •  一整个雨季
    2021-01-28 01:23

    This answer to this is similar to this other question.

    The call to JanusGraphFactory.getGraphNames() needs to be sent to the remote server. If you're working in the Gremlin Console, first establish a remote sessioned connection then set remote console mode.

    gremlin> :remote connect tinkerpop.server conf/remote.yaml session
    ==>Configured localhost/127.0.0.1:8182
    
    gremlin> :remote console
    ==>All scripts will now be sent to Gremlin Server - [localhost:8182]-[5206cdde-b231-41fa-9e6c-69feac0fe2b2] - type ':remote console' to return to local mode
    

    Then as described in the JanusGraph docs for "Listing the Graphs":

    ConfiguredGraphFactory.getGraphNames() will return a set of graph names for which you have created configurations using the ConfigurationManagementGraph APIs.

    JanusGraphFactory.getGraphNames() on the other hand returns a set of graph names for which you have instantiated and the references are stored inside the JanusGraphManager.

    If you are not using the Gremlin Console, then you should be using a remote client, such as the TinkerPop gremlin-driver (Java), to send your requests to the Gremlin Server.

    0 讨论(0)
提交回复
热议问题