Ravi B.
Ravi B.

Reputation: 11

Embedded db not starting with bolt connector (neo4j 3.2.0)

I am trying to create and use an embedded Neo4j instance in a clojure app. Following the documentation in Neo4j API guide, I was able to create following code:

(defn make-embedded-db
[path]
(let [factory (GraphDatabaseFactory.)]
    (-> (.newEmbeddedDatabaseBuilder factory path)
        (.loadPropertiesFromFile "resources/neo4j.conf")
        (.newGraphDatabase))))

I am importing the following libraries:

(:import [java.io ByteArrayInputStream ByteArrayOutputStream]
         [org.neo4j.graphdb Direction
                            GraphDatabaseService
                            Node
                            Relationship
                            RelationshipType
                            Transaction]
         [org.neo4j.graphdb.factory GraphDatabaseFactory])

I have bolt enabled in the conf file as follows:

dbms.connector.bolt.enabled=true

When I execute the make-embedded-db function I get the following error:

CompilerException java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory, /path/to/graphdb, compiling:(form-init7747172741153885056.clj:1:9)

If I disable bolt connector in config - it seems to work fine. My main motivation to enable bolt connector is that I can connect a neo4j browser to visualize and explore the graphdb.

I came across posts for previous versions of neo4j embedded having similar issues that were resolved by using WrappingNeoServerBootStrapper which has been deprecated. Has anyone run into this issue and point me in the right direction.

EDITED I was getting the above error when assigning the embedded db instance to a global var like this

(def db (make-embedded-db (io/file "resources/data/graphdb")))

However just calling the function itself i.e.

(make-embedded-db (io/file "resources/data/graphdb"))

gave the actual error:

VerifyError class org.bouncycastle.asn1.x500.X500Name overrides final method equals

Upvotes: 0

Views: 214

Answers (1)

Ravi B.
Ravi B.

Reputation: 11

Basically, a quick google of the error suggested there might be multiple paths to bouncycastle included in classpath - checking the debug.log in the graphdb folder actually confirmed this. I was including incanter in the same project and it was also adding it's own path for bouncycastle thus causing this issue. Removing it solved the issue.

Upvotes: 1

Related Questions