I'm trying to connect to a JanusGraph server running in a docker container. I can connect just fine from the gremlin console. To connect from a Java app I'm following the directions here. mvn package
builds. But when I run the app, java -cp target/eh-0.1.jar com.example.Main
it throws this error:
Caused by: java.lang.IllegalArgumentException: Configuration file at conf/remote-objects.yaml does not exist
at org.apache.tinkerpop.gremlin.driver.Cluster.open(Cluster.java:262)
at org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection.<init>(DriverRemoteConnection.java:77)
The remote-graph.properties
and remote-objects.yaml
files are under resources and are cut and pastes from the directions. The application can find the remote-graph.properties
which references the conf/remote-objects.yaml
file.
The Java code is:
package com.example
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import static org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource.traversal;
public class Main {
public static void main(String[] args) {
try {
GraphTraversalSource g = traversal().withRemote("conf/remote-graph.properties");
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}
I can not figure out why it isn't finding the conf/remote-objects.yaml
file.