I'm trying to remotely open an existing graph from Java application. But I keep on getting the following error.
"org.janusgraph.graphdb.management.utils.ConfigurationManagementGraphNotEnabledException: Please add a key named "ConfigurationManagementGraph" to the "graphs" property in your YAML file and restart the server to be able to use the functionality of the ConfigurationManagementGraph class."
Here is my Java Code sample:
RemoteGraph.java
---
01| cluster = Cluster.open(conf.getString("gremlin.remote.driver.clusterFile"));
02| client = cluster.connect();
03| JanusGraph airroutes = ConfiguredGraphFactory.open("airroutes");
I'm always getting that error on the line number 03.
jgex-remote.properties
---
gremlin.remote.remoteConnectionClass=org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection
gremlin.remote.driver.clusterFile=conf/remote-objects.yaml
gremlin.remote.driver.sourceName=g
conf/remote-objects.yaml
---
hosts: [localhost]
port: 8182
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0,
config: {
ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry]
}
}
Below is the server configuration.
conf/gremlin-server/gremlin-server.yaml
---
host: 0.0.0.0
port: 8182
scriptEvaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphManager: org.janusgraph.graphdb.management.JanusGraphManager
graphs: {
ConfigurationManagementGraph: conf/gremlin-server/janusgraph-cql-es-server.properties
}
plugins:
- janusgraph.imports
scriptEngines: {
gremlin-groovy: {
imports: [java.lang.Math],
staticImports: [java.lang.Math.PI],
scripts: [scripts/empty-sample.groovy]}}
...
conf/gremlin-server/janusgraph-cql-es-server.properties
---
gremlin.graph=org.janusgraph.core.JanusGraphFactory
graph.graphname=ConfigurationManagementGraph
storage.backend=cql
storage.hostname=127.0.0.1
storage.cql.keyspace=janusgraph
...
index.search.backend=elasticsearch
index.search.hostname=127.0.0.1
index.search.elasticsearch.client-only=true
I'm not able to figure out what am I missing. Whatever API I'm trying from ConfiguredGraphFactory I'm getting the same error. Anyone has any idea or any link that I can refer to? I have tried everything from the Janusgraph documentation.