Unable to use ConfiguredGraphFactory from Java Application


"rahuln...@gmail.com" <maxzo...@...>
 

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.


chris...@...
 

Really late response, but 

gremlin.graph=org.janusgraph.core.JanusGraphFactory
should be:
gremlin.graph=org.janusgraph.core.ConfiguredGraphFactory

I just saw that it's wrong in the documentation. Sorry for the frustration that must have caused you. I'll open an issue to fix the mistake.

Regards,

Chris


On Saturday, December 8, 2018 at 6:36:20 PM UTC-8, Rahul Nandi wrote:
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.


jsn...@...
 

Hi

JanusGraph 0.4.1 has the same problem, Did you find any solution ?

I would like to find a solution on internet, but It's impossible because the documentation is null, even if you read the official documentation

:(

Greetings from México


El sábado, 8 de diciembre de 2018, 20:36:20 (UTC-6), rah...@... escribió:
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.


searcha...@...
 

+1


On Sunday, December 9, 2018 at 8:06:20 AM UTC+5:30, rah...@... wrote:
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.


sparshneel chanchlani <sparshneel...@...>
 

U need to change the Janusgraph-cql-es-server.properties to user configuredGraphFactory instead of Janusgraph Factory.
 Then When u open graph using Java API use the code below
graph=ConfiguredGraphFactory.open("graph.name"); 


On Wed, Jul 8, 2020, 5:18 PM <searcha...@...> wrote:
+1

On Sunday, December 9, 2018 at 8:06:20 AM UTC+5:30, rah...@... wrote:
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.

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgra...@....
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/20cf47ea-4d45-4271-ac8c-923692e0eb96o%40googlegroups.com.


Nitin Poddar <hitk.ni...@...>
 

I recently encountered these issue and worked my way out. So I thought of writing few post to share the information. You can read this may be it will be helpful





On Saturday, December 8, 2018 at 9:36:20 PM UTC-5, rah...@... wrote:
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.