Pepijn
Pepijn

Reputation: 4253

Include Neo4j server in jar

I am creating a Clojure application that uses Neo4J via the REST API, and I would like to include Neo4j as a dependency.

I read that it is possible to embed Neo4j http://docs.neo4j.org/chunked/stable/tutorials-java-embedded.html

But is it also possible to use the REST API that way?

This is what my project.clj looks like:

(defproject example "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [clojurewerkz/neocons "2.0.0"]
                 [org.neo4j.app/neo4j-server "2.1.0-M01"]]
  :aliases {"neo4j" ["run" "-m" "org.neo4j.server.Bootstrapper"]}
  :jvm-opts ["-Dorg.neo4j.server.database.location=data/graph.db"]
)

But it fails with WARNING: The key [org.neo4j.server.database.location] is missing from the Neo Server configuration. and then throws a bunch of exceptions, indicating it did not find a database location.

I tried adding the above JVM opts, and copied the neo4j-server.properties to the resources folder without any luck.

Upvotes: 0

Views: 106

Answers (2)

Michael Hunger
Michael Hunger

Reputation: 41676

Or you create your own subclass of CommunityBoostrapper that also accepts the argument from the command line, should be easy enough.

Check my little side project for some hints:

https://github.com/jexp/neo4j-in-memory-server

Upvotes: 0

Jacek Lach
Jacek Lach

Reputation: 381

Neo4j will look for the configuration in /etc/neo/conf/neo4j-server.properties. Try putting the 'org.neo4j.server.database.location=data/graph.db' in there.

Upvotes: 1

Related Questions