JanusGraph / JanusGraph/janusgraph

add a key named "ConfigurationManagementGraph" to the "graphs" property

Open
#1,322 13 comments 2 reactions 0 assignees View on GitHub
kind/bug/possible
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

Please help to have a look, thanks!
I've configured ConfigurationManagementGraph!But it still reported an error。
config:
![image](https://user-images.githubusercontent.com/9508140/48998248-e9344600-f18d-11e8-9f33-f3ef32c3266d.png)
![image](https://user-images.githubusercontent.com/9508140/48998329-1d0f6b80-f18e-11e8-8cfa-7666f718417b.png)

my code is:
`
@Test
public void graphConfigurationShouldBeWhatWeExpectWhenUsingTemplateConfiguration()
throws Exception {

try {

JanusGraphManager gm;
Settings set =new Settings();
set.host="172.16.161.115";
gm = new JanusGraphManager(set);
final Map map = new HashMap<>();
map.put(STORAGE_BACKEND.toStringWithoutRoot(), "hbase");
map.put("storage.hostname", "172.16.161.115");
//ConfiguredGraphFactory.createTemplateConfiguration(new MapConfiguration(map));
ConfigurationManagementGraph instance = ConfigurationManagementGraph.getInstance();
final StandardJanusGraph graph = (StandardJanusGraph) ConfiguredGraphFactory.create("ghlml");
final StandardJanusGraph graph1 = (StandardJanusGraph) ConfiguredGraphFactory.open("ghlml");
instance.createTemplateConfiguration(new MapConfiguration(map));
Set graphNames = ConfiguredGraphFactory.getGraphNames();
for(String str:graphNames){
System.out.println("---"+str);
}
assertNotNull(graph);
assertEquals(graph, graph1);

assertEquals("ghlml", graph.getConfiguration().getConfiguration().get(GRAPH_NAME));
// assertEquals("inmemory", graph.getConfiguration().getConfiguration().get(STORAGE_BACKEND));

} finally {
//ConfiguredGraphFactory.removeConfiguration("graph1");
//ConfiguredGraphFactory.close("graph1");
}
}
`

error code:
`
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.
at org.janusgraph.graphdb.management.ConfigurationManagementGraph.getInstance(ConfigurationManagementGraph.java:97)
at pluradj.janusgraph.example.ConfiguredGraphFactoryTest.graphConfigurationShouldBeWhatWeExpectWhenUsingTemplateConfiguration(ConfiguredGraphFactoryTest.java:143)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

java.lang.RuntimeException: 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.
at org.janusgraph.core.ConfiguredGraphFactory.getConfigGraphManagementInstance(ConfiguredGraphFactory.java:169)
at org.janusgraph.core.ConfiguredGraphFactory.removeTemplateConfiguration(ConfiguredGraphFactory.java:258)
at pluradj.janusgraph.example.ConfiguredGraphFactoryTest.cleanUp(ConfiguredGraphFactoryTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: 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.
at org.janusgraph.graphdb.management.ConfigurationManagementGraph.getInstance(ConfigurationManagementGraph.java:97)
at org.janusgraph.core.ConfiguredGraphFactory.getConfigGraphManagementInstance(ConfiguredGraphFactory.java:167)
... 27 more

`

Contributor guide

Open the contributing guide

Research direction

Start at ConfigurationManagementGraph.java:97 and ConfiguredGraphFactory.java:167-169, then inspect the YAML configuration shown in the issue and ConfiguredGraphFactoryTest.graphConfigurationShouldBeWhatWeExpectWhenUsingTemplateConfiguration. Reproduce the failure and verify that the ConfigurationManagementGraph exception no longer occurs when the graphs configuration is used.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.