Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the Bolt port of the embedded graph #65

Open
augustearth opened this issue Sep 27, 2021 · 2 comments
Open

Expose the Bolt port of the embedded graph #65

augustearth opened this issue Sep 27, 2021 · 2 comments

Comments

@augustearth
Copy link
Collaborator

Export the Bolt port by default of the embedded graph so that things like Neo4j Desktop can interact with it.

@augustearth
Copy link
Collaborator Author

augustearth commented Sep 27, 2021

Ugh. It would seem that we can't due (again) to a limitation of neo4j-tinkerpop-api-impl. I based my approach on Accessing Neo4j embedded via the Bolt protocol. In order to get the code to compile, the commented dependencies below were required.

        implementation "org.apache.tinkerpop:neo4j-gremlin:${gremlinVersion}"
        implementation "org.neo4j:neo4j-tinkerpop-api-impl:${neo4jTinkerpopVersion}"
        implementation "org.neo4j.driver:neo4j-java-driver:${neo4JavaDriverVersion}"
        //implementation "org.neo4j:parent:${neo4JavaDriverVersion}"
        //implementation "org.neo4j:neo4j-community:${neo4JavaDriverVersion}"
        //implementation "org.neo4j:neo4j-bolt:${neo4JavaDriverVersion}"

However, adding the neo4j-bolt dependency causes the following error in our core code:

CoreGraphNeo4jSpec > initializationError FAILED
    java.lang.NoClassDefFoundError: org/neo4j/graphdb/factory/GraphDatabaseFactory
        at java.base/java.lang.Class.forName(Class.java:315)
        at org.neo4j.tinkerpop.api.Neo4jFactory$Builder.open(Neo4jFactory.java:31)
        at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.<init>(Neo4jGraph.java:135)
        at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.open(Neo4jGraph.java:149)
        at carnival.core.graph.CoreGraphNeo4j.openGremlinGraph(CoreGraphNeo4j.groovy:127)
        at carnival.core.graph.CoreGraphNeo4j.create(CoreGraphNeo4j.groovy:54)
        at carnival.core.graph.CoreGraphNeo4jSpec.setupSpec(CoreGraphNeo4jSpec.groovy:61)

        Caused by:
        java.lang.ClassNotFoundException: org.neo4j.graphdb.factory.GraphDatabaseFactory
            at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
            at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
            at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
            ... 7 more

Our current dependency versions are:

groovyVersion=3.0.7
gremlinVersion=3.4.10
neo4jTinkerpopVersion=0.9-3.4.0
neo4JavaDriverVersion=4.1.1
javaVersion=11

Version 0.9-3.4.0 of neo4j-tinkerpop-api-impl was published in January of 2019. Version 4.1.1 of neo4j-java-driver and neo4j-bolt were published in 2020. neo4j-java-driver seems to be ok, but simply adding the dependency neo4j-bolt causes our code to fail even if there is no reference in our code to anything neo4j-bolt. Just adding the dependency messes things up.

@th5
Copy link
Contributor

th5 commented Feb 11, 2022

I was able to get it to compile by setting neo4JavaDriverVersion=1.7.5

2.0.0-alpha3 also works. 4.0.0 does not. There doesn't appear to be a 3.x release.

https://mvnrepository.com/artifact/org.neo4j.driver/neo4j-java-driver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants