JanusGraph interface using Java

I am planning to use JanusGraph in my spring boot Java web application, in my windows dev box , running JanusGraph in a docker container, and running my Java outside of , unable to successfully establish a connection with JanusGraph. Can anyone please provide details on which dependencies to be used and the API to use , and any example with sample
12 Replies
Bo
Bo2y ago
You just need
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-driver</artifactId>
<version>3.6.2</version>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-driver</artifactId>
<version>3.6.2</version>
</dependency>
Bo
Bo2y ago
I have a personal project that uses JanusGraph server + Spring Boot that you might want to reference: https://github.com/li-boxuan/citegraph
GitHub
GitHub - li-boxuan/citegraph: CiteGraph: A citation graph web visua...
CiteGraph: A citation graph web visualizer. Contribute to li-boxuan/citegraph development by creating an account on GitHub.
joybytes
joybytesOP2y ago
@boxuanli thanks , I am now getting java.net.ConnectException : connection refused : no further information.
Bo
Bo2y ago
Where are you getting that error?
joybytes
joybytesOP2y ago
@boxuanli Basically it is working good in the Linux machine. Thanks to your sample project. Issue in the Windows , where i am running Janusgraph in the docker and web app outside. seems like my client program request to the Janusgraph is rejected. While now i continue my development in the Linux , i am getting io.netty.handler.codec.DecoderException while adding an edge. io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(162) + length(615279) exceeds writerIndex(210): CompositeByteBuf(ridx: 162, widx: 210, cap: 210, components=1). Any insight will be helpful. @boxuanli Basically it is working good in the Linux machine. Thanks to your sample project. Issue in the Windows , where i am running Janusgraph in the docker and web app outside. seems like my client program request to the Janusgraph is rejected.
Bo
Bo2y ago
Could it be possible that you use one JanusGraph version/config setting to create the graph, but a different JanusGraph version/config setting to read the graph?
joybytes
joybytesOP2y ago
Nope it is same
Bo
Bo2y ago
What's the JanusGraph server and client version you are using? Can you also provide all of your config files please
joybytes
joybytesOP2y ago
Using server version --> janusgraph-0.6.3 , pom.xml --> <janusgraph.version>1.0.0-20230428-082704.5159135</janusgraph.version> , gremline -- > 3.6.2
Bo
Bo2y ago
Why do you need janusgraph.version in your pom.xml? Although not sure why you include janusgraph dependency in your maven project, it is clearly a different version than your server version.
joybytes
joybytesOP2y ago
Basically I am using JanusGraphIoRegistry which is available in janusgraph-core artifact , any other alternative ? Thank you, version issue is resolved.
Bo
Bo2y ago
Basically I am using JanusGraphIoRegistry which is available in janusgraph-core artifact
Oh yeah I see. janusgraph-driver should be enough for your purpose, but it doesn't harm to include janusgraph-core. Back to your problem. You say the setup works on Linux but not on Windows. What exactly does it mean? When you run both client and server on Linux, it works, but not when you run both on Windows? OR you are running the server on Linux, and the client on Windows?
Want results from more Discord servers?
Add your server