0
votes

I see that 'blueprints-neo4j-graph-2.5.0' is the latest released version to use tinkerpop blueprints api with neo4j graph which is version 1.9.6.

A few questions on this:

  1. I understand that this neo4j instance will be an embedded database with community version. Is that right? If so, how do I switch to enterprise version?

    I tried including this as gradle dependency: compile group: 'org.neo4j', name: 'neo4j-enterprise', version:'2.0.1'

    But, I think 'blueprints-neo4j-graph-2.5.0' will get its own version(neo4j 1.9.6) as a dependency.

  2. Is it possible to use neo4j webadmin console with the embedded version?

    I tried changing the database location in neo4j.server.properties to the same location as given in the configuration for embedded instance, but I am not able to access them simultaneously.

I made this change in my build.gradle.

compile group: 'com.tinkerpop.blueprints', name: 'blueprints-neo4j2-graph', version:'2.5.0'

This picks up neo4j 2.0.1.

Also, I changed the tinkerpopConfig ( I am using GraphFactory to open and close the graph) as mentioned in tinkerpop sample to be:

"blueprints.neo4jha.directory" : "C:/data/my-test-model-graph",
"blueprints.graph" : "com.tinkerpop.blueprints.impls.neo4j2.Neo4j2HaGraph",
"blueprints.neo4jha.conf.server_id" : "1",
"blueprints.neo4jha.conf.server" : "localhost:6364",
"blueprints.neo4jha.conf.cluster_server" : "localhost:5002",
"blueprints.neo4jha.conf.initial_hosts" : "localhost:5001,localhost:5002"

Now when I try to deploy, I get a null graph.

When you said, HA implementation requires Enterprise edition:

I also tried doing it this way,

compile(group: 'com.tinkerpop.blueprints', name: 'blueprints-neo4j2-graph', version:'2.5.0'){
exclude(module: 'neo4j')
exclude(module: 'neo4j-ha')
exclude(module: 'neo4j-management')
    }
compile group: 'org.neo4j', name: 'neo4j-enterprise', version:'2.0.1'

which will get neo4j-enterprise-2.0.1.

But this also doesn't seem to work and is not able to open a graph instance.

Do you see anything odd here?

java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [com.tinkerpop.blueprints.impls.neo4j2.Neo4j2HaGraph]. at com.tinkerpop.blueprints.GraphFactory.open(GraphFactory.java:50) ~[blueprints-core-2.5.0.jar:na] at com.repo.GraphManager.getGraphDatabase(GraphManager.java:314) [com.repo~repo_module~1.0.0-SNAPSHOT/:na] at com.repo.GraphManager.start(GraphManager.java:164) [com.repo~repo_module~1.0.0-SNAPSHOT/:na] at org.vertx.java.platform.Verticle.start(Verticle.java:82) [vertx-platform-2.1M1.jar:na] at com.englishtown.vertx.hk2.HK2VerticleLoader.start(HK2VerticleLoader.java:77) [com.englishtown~vertx-mod-hk2~1.6.0-SNAPSHOT/:na] at org.vertx.java.platform.impl.DefaultPlatformManager$19.run(DefaultPlatformManager.java:1551) [vertx-platform-2.1M1.jar:na] at org.vertx.java.core.impl.DefaultContext$3.run(DefaultContext.java:176) [vertx-core-2.1M1.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_51] at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51] Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_51] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_51] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_51] at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_51] at com.tinkerpop.blueprints.GraphFactory.open(GraphFactory.java:43) ~[blueprints-core-2.5.0.jar:na] ... 9 common frames omitted Caused by: java.lang.NullPointerException: null at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1124) ~[na:1.7.0_51] at java.util.concurrent.ConcurrentHashMap.putAll(ConcurrentHashMap.java:1162) ~[na:1.7.0_51] at org.neo4j.kernel.configuration.Config.applyChanges(Config.java:122) ~[neo4j-kernel-2.0.1.jar:2.0.1] at org.neo4j.kernel.configuration.Config.<init>(Config.java:88) ~[neo4j-kernel-2.0.1.jar:2.0.1] at org.neo4j.kernel.InternalAbstractGraphDatabase.<init>(InternalAbstractGraphDatabase.java:278) ~[neo4j-kernel-2.0.1.jar:2.0.1] at org.neo4j.kernel.ha.HighlyAvailableGraphDatabase.<init>(HighlyAvailableGraphDatabase.java:136) ~[neo4j-ha-2.0.1.jar:2.0.1] at org.neo4j.graphdb.factory.HighlyAvailableGraphDatabaseFactory$1.newDatabase(HighlyAvailableGraphDatabaseFactory.java:47) ~[neo4j-ha-2.0.1.jar:2.0.1] at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:198) ~[neo4j-kernel-2.0.1.jar:2.0.1] at com.tinkerpop.blueprints.impls.neo4j2.Neo4j2HaGraph.<init>(Neo4j2HaGraph.java:23) ~[blueprints-neo4j2-graph-2.5.0.jar:na] at com.tinkerpop.blueprints.impls.neo4j2.Neo4j2HaGraph.<init>(Neo4j2HaGraph.java:31) ~[blueprints-neo4j2-graph-2.5.0.jar:na] ... 14 common frames omitted

1

1 Answers

0
votes

If you want Neo4j 2.x then you need to use this dependency:

<dependency>
  <groupId>com.tinkerpop.blueprints</groupId>
  <artifactId>blueprints-neo4j2-graph</artifactId>
  <version>2.5.0</version>
</dependency>

As this version runs in embedded mode only one JVM process at a time can access the database, so you can't access a database via TinkerPop and have Neo4j Server running at the same time to get the Neo4j WebAdmin Console. If you want to run in that mode then you should use Neo4jHaGraph:

https://github.com/tinkerpop/blueprints/wiki/Neo4jHa-Implementation

which requires Enterprise Edition:

http://docs.neo4j.org/chunked/stable/ha-setup-tutorial.html

Neo4jHaGraph should also exist in the blueprints-neo4j2-graph packaging.