Unable to use ConfiguredGraphFactory from Java Application

197 views
Skip to first unread message

maxzo...@gmail.com

unread,
Dec 8, 2018, 9:36:20 PM12/8/18
to JanusGraph users
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....@gmail.com

unread,
Jan 9, 2019, 11:26:04 PM1/9/19
to JanusGraph users
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

jsn...@gmail.com

unread,
Feb 5, 2020, 7:41:45 AM2/5/20
to JanusGraph users
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

searcha...@gmail.com

unread,
Jul 8, 2020, 7:48:46 AM7/8/20
to JanusGraph users
+1

sparshneel chanchlani

unread,
Jul 8, 2020, 7:54:28 AM7/8/20
to janusgra...@googlegroups.com
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"); 

--
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 janusgraph-use...@googlegroups.com.
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

unread,
Jul 12, 2020, 9:53:24 PM7/12/20
to JanusGraph users
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


Reply all
Reply to author
Forward
0 new messages