Linking Java to Neo4J server
up vote
1
down vote
favorite
I am trying to connect Java to Neo4J for a project. I want to connect an already existing Neo4J database (local) to Java but I have the following error :
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory, /home/etudiants/helloStackOverflow/workspace/projetnosql/graph.db
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:212)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:125)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:137)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:130)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:107)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:199)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:75)
at Main.main(Main.java:12)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.NeoStoreDataSource@1a942c18' was successfully initialized, but failed to start. Please see the attached cause exception "No dependency satisfies type class org.neo4j.kernel.api.index.IndexProvider".
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:466)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:100)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:208)
... 7 more
Caused by: org.neo4j.kernel.impl.util.UnsatisfiedDependencyException: No dependency satisfies type class org.neo4j.kernel.api.index.IndexProvider
at org.neo4j.kernel.impl.util.Dependencies.resolveDependency(Dependencies.java:73)
at org.neo4j.kernel.impl.util.Dependencies.resolveDependency(Dependencies.java:68)
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:387)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
... 12 more
My pom.xml :
<properties>
<!-- to be overridden in sub modules -->
<java-module-name></java-module-name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<commonslang>3.4</commonslang>
<commonsio>2.4</commonsio>
<jackson>2.8.11</jackson>
<httpclient>4.5.2</httpclient>
<junit>4.12</junit>
<assertj>3.8.0</assertj>
<slf4j>1.7.21</slf4j>
<logback>1.1.7</logback>
<mockito>2.2.29</mockito>
<!-- default for build, if no profiles invoked -->
<neo4j>3.0.4</neo4j>
<bolt>1.6.3</bolt>
<fast.classpath.scanner>2.18.1</fast.classpath.scanner>
<ogm.properties>ogm-bolt.properties</ogm.properties>
<neo4j.edition>enterprise</neo4j.edition>
<spotbugs.plugin.version>3.1.3</spotbugs.plugin.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.neo4j/neo4j-kernel -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>3.0.4</version>
</dependency>
<!--Compile and Runtime Dependencies -->
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>${bolt}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commonslang}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commonsio}</version>
</dependency>
<!-- Embedded Driver Dependencies -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cluster</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ha</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-enterprise</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.neo4j/neo4j-graphdb-api -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-graphdb-api</artifactId>
<version>3.4.9</version>
</dependency>
</dependencies>
and my Main.java :
import java.io.File;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
public class Main {
public static void main(String args) {
//GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();
File p = new File("/home/etudiants/helloStackOverflow/workspace/projetnosql/graph.db");
GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(p);
db.shutdown();
System.out.println("ça marche!!!!!");
try (Transaction tx = db.beginTx()) {
// Perform DB operations
System.out.println("ça marche 2");
tx.success();
}
}
}
Apparantly the problem comes from a missing dependency to satisfy the class org.neo4j.kernel.api.index.IndexProvider but there kernel-api dependency is specified.
Do you have any idea how I could fix this problem?
Additional informations :
IDE : Intellij
Maven : v1.8
Neo4J : v3.4.9
I hope I provided enough information so you can give me suggestion on how to fix the problem.
java neo4j
add a comment |
up vote
1
down vote
favorite
I am trying to connect Java to Neo4J for a project. I want to connect an already existing Neo4J database (local) to Java but I have the following error :
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory, /home/etudiants/helloStackOverflow/workspace/projetnosql/graph.db
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:212)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:125)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:137)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:130)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:107)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:199)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:75)
at Main.main(Main.java:12)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.NeoStoreDataSource@1a942c18' was successfully initialized, but failed to start. Please see the attached cause exception "No dependency satisfies type class org.neo4j.kernel.api.index.IndexProvider".
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:466)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:100)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:208)
... 7 more
Caused by: org.neo4j.kernel.impl.util.UnsatisfiedDependencyException: No dependency satisfies type class org.neo4j.kernel.api.index.IndexProvider
at org.neo4j.kernel.impl.util.Dependencies.resolveDependency(Dependencies.java:73)
at org.neo4j.kernel.impl.util.Dependencies.resolveDependency(Dependencies.java:68)
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:387)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
... 12 more
My pom.xml :
<properties>
<!-- to be overridden in sub modules -->
<java-module-name></java-module-name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<commonslang>3.4</commonslang>
<commonsio>2.4</commonsio>
<jackson>2.8.11</jackson>
<httpclient>4.5.2</httpclient>
<junit>4.12</junit>
<assertj>3.8.0</assertj>
<slf4j>1.7.21</slf4j>
<logback>1.1.7</logback>
<mockito>2.2.29</mockito>
<!-- default for build, if no profiles invoked -->
<neo4j>3.0.4</neo4j>
<bolt>1.6.3</bolt>
<fast.classpath.scanner>2.18.1</fast.classpath.scanner>
<ogm.properties>ogm-bolt.properties</ogm.properties>
<neo4j.edition>enterprise</neo4j.edition>
<spotbugs.plugin.version>3.1.3</spotbugs.plugin.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.neo4j/neo4j-kernel -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>3.0.4</version>
</dependency>
<!--Compile and Runtime Dependencies -->
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>${bolt}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commonslang}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commonsio}</version>
</dependency>
<!-- Embedded Driver Dependencies -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cluster</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ha</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-enterprise</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.neo4j/neo4j-graphdb-api -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-graphdb-api</artifactId>
<version>3.4.9</version>
</dependency>
</dependencies>
and my Main.java :
import java.io.File;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
public class Main {
public static void main(String args) {
//GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();
File p = new File("/home/etudiants/helloStackOverflow/workspace/projetnosql/graph.db");
GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(p);
db.shutdown();
System.out.println("ça marche!!!!!");
try (Transaction tx = db.beginTx()) {
// Perform DB operations
System.out.println("ça marche 2");
tx.success();
}
}
}
Apparantly the problem comes from a missing dependency to satisfy the class org.neo4j.kernel.api.index.IndexProvider but there kernel-api dependency is specified.
Do you have any idea how I could fix this problem?
Additional informations :
IDE : Intellij
Maven : v1.8
Neo4J : v3.4.9
I hope I provided enough information so you can give me suggestion on how to fix the problem.
java neo4j
2
Is it correct todb.shutdown()
before running aTransaction
on the database?
– deHaar
Nov 19 at 11:00
Is the Neo4j graph database a Community or Enterprise version? If it is an Enterprise version then forGraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(p);
changeGraphDatabaseFactory
toEnterpriseGraphDatabaseFactory
.
– Guy Coder
Nov 19 at 15:15
Of interest: Neo4j Java Reference - Chapter 4. Using Neo4j embedded in Java applications 4.1.4. Starting and stopping -If you are using the Enterprise Edition of Neo4j in embedded mode, you have to create your database with the EnterpriseGraphDatabaseFactory to enable the Enterprise Edition features.
– Guy Coder
Nov 19 at 15:18
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am trying to connect Java to Neo4J for a project. I want to connect an already existing Neo4J database (local) to Java but I have the following error :
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory, /home/etudiants/helloStackOverflow/workspace/projetnosql/graph.db
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:212)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:125)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:137)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:130)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:107)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:199)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:75)
at Main.main(Main.java:12)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.NeoStoreDataSource@1a942c18' was successfully initialized, but failed to start. Please see the attached cause exception "No dependency satisfies type class org.neo4j.kernel.api.index.IndexProvider".
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:466)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:100)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:208)
... 7 more
Caused by: org.neo4j.kernel.impl.util.UnsatisfiedDependencyException: No dependency satisfies type class org.neo4j.kernel.api.index.IndexProvider
at org.neo4j.kernel.impl.util.Dependencies.resolveDependency(Dependencies.java:73)
at org.neo4j.kernel.impl.util.Dependencies.resolveDependency(Dependencies.java:68)
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:387)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
... 12 more
My pom.xml :
<properties>
<!-- to be overridden in sub modules -->
<java-module-name></java-module-name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<commonslang>3.4</commonslang>
<commonsio>2.4</commonsio>
<jackson>2.8.11</jackson>
<httpclient>4.5.2</httpclient>
<junit>4.12</junit>
<assertj>3.8.0</assertj>
<slf4j>1.7.21</slf4j>
<logback>1.1.7</logback>
<mockito>2.2.29</mockito>
<!-- default for build, if no profiles invoked -->
<neo4j>3.0.4</neo4j>
<bolt>1.6.3</bolt>
<fast.classpath.scanner>2.18.1</fast.classpath.scanner>
<ogm.properties>ogm-bolt.properties</ogm.properties>
<neo4j.edition>enterprise</neo4j.edition>
<spotbugs.plugin.version>3.1.3</spotbugs.plugin.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.neo4j/neo4j-kernel -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>3.0.4</version>
</dependency>
<!--Compile and Runtime Dependencies -->
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>${bolt}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commonslang}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commonsio}</version>
</dependency>
<!-- Embedded Driver Dependencies -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cluster</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ha</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-enterprise</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.neo4j/neo4j-graphdb-api -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-graphdb-api</artifactId>
<version>3.4.9</version>
</dependency>
</dependencies>
and my Main.java :
import java.io.File;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
public class Main {
public static void main(String args) {
//GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();
File p = new File("/home/etudiants/helloStackOverflow/workspace/projetnosql/graph.db");
GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(p);
db.shutdown();
System.out.println("ça marche!!!!!");
try (Transaction tx = db.beginTx()) {
// Perform DB operations
System.out.println("ça marche 2");
tx.success();
}
}
}
Apparantly the problem comes from a missing dependency to satisfy the class org.neo4j.kernel.api.index.IndexProvider but there kernel-api dependency is specified.
Do you have any idea how I could fix this problem?
Additional informations :
IDE : Intellij
Maven : v1.8
Neo4J : v3.4.9
I hope I provided enough information so you can give me suggestion on how to fix the problem.
java neo4j
I am trying to connect Java to Neo4J for a project. I want to connect an already existing Neo4J database (local) to Java but I have the following error :
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory, /home/etudiants/helloStackOverflow/workspace/projetnosql/graph.db
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:212)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:125)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:137)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:130)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:107)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:199)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:75)
at Main.main(Main.java:12)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.NeoStoreDataSource@1a942c18' was successfully initialized, but failed to start. Please see the attached cause exception "No dependency satisfies type class org.neo4j.kernel.api.index.IndexProvider".
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:466)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:100)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:208)
... 7 more
Caused by: org.neo4j.kernel.impl.util.UnsatisfiedDependencyException: No dependency satisfies type class org.neo4j.kernel.api.index.IndexProvider
at org.neo4j.kernel.impl.util.Dependencies.resolveDependency(Dependencies.java:73)
at org.neo4j.kernel.impl.util.Dependencies.resolveDependency(Dependencies.java:68)
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:387)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
... 12 more
My pom.xml :
<properties>
<!-- to be overridden in sub modules -->
<java-module-name></java-module-name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<commonslang>3.4</commonslang>
<commonsio>2.4</commonsio>
<jackson>2.8.11</jackson>
<httpclient>4.5.2</httpclient>
<junit>4.12</junit>
<assertj>3.8.0</assertj>
<slf4j>1.7.21</slf4j>
<logback>1.1.7</logback>
<mockito>2.2.29</mockito>
<!-- default for build, if no profiles invoked -->
<neo4j>3.0.4</neo4j>
<bolt>1.6.3</bolt>
<fast.classpath.scanner>2.18.1</fast.classpath.scanner>
<ogm.properties>ogm-bolt.properties</ogm.properties>
<neo4j.edition>enterprise</neo4j.edition>
<spotbugs.plugin.version>3.1.3</spotbugs.plugin.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.neo4j/neo4j-kernel -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>3.0.4</version>
</dependency>
<!--Compile and Runtime Dependencies -->
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>${bolt}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commonslang}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commonsio}</version>
</dependency>
<!-- Embedded Driver Dependencies -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cluster</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ha</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-enterprise</artifactId>
<version>${neo4j}</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.neo4j/neo4j-graphdb-api -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-graphdb-api</artifactId>
<version>3.4.9</version>
</dependency>
</dependencies>
and my Main.java :
import java.io.File;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
public class Main {
public static void main(String args) {
//GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();
File p = new File("/home/etudiants/helloStackOverflow/workspace/projetnosql/graph.db");
GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(p);
db.shutdown();
System.out.println("ça marche!!!!!");
try (Transaction tx = db.beginTx()) {
// Perform DB operations
System.out.println("ça marche 2");
tx.success();
}
}
}
Apparantly the problem comes from a missing dependency to satisfy the class org.neo4j.kernel.api.index.IndexProvider but there kernel-api dependency is specified.
Do you have any idea how I could fix this problem?
Additional informations :
IDE : Intellij
Maven : v1.8
Neo4J : v3.4.9
I hope I provided enough information so you can give me suggestion on how to fix the problem.
java neo4j
java neo4j
asked Nov 19 at 10:56
Copp
254
254
2
Is it correct todb.shutdown()
before running aTransaction
on the database?
– deHaar
Nov 19 at 11:00
Is the Neo4j graph database a Community or Enterprise version? If it is an Enterprise version then forGraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(p);
changeGraphDatabaseFactory
toEnterpriseGraphDatabaseFactory
.
– Guy Coder
Nov 19 at 15:15
Of interest: Neo4j Java Reference - Chapter 4. Using Neo4j embedded in Java applications 4.1.4. Starting and stopping -If you are using the Enterprise Edition of Neo4j in embedded mode, you have to create your database with the EnterpriseGraphDatabaseFactory to enable the Enterprise Edition features.
– Guy Coder
Nov 19 at 15:18
add a comment |
2
Is it correct todb.shutdown()
before running aTransaction
on the database?
– deHaar
Nov 19 at 11:00
Is the Neo4j graph database a Community or Enterprise version? If it is an Enterprise version then forGraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(p);
changeGraphDatabaseFactory
toEnterpriseGraphDatabaseFactory
.
– Guy Coder
Nov 19 at 15:15
Of interest: Neo4j Java Reference - Chapter 4. Using Neo4j embedded in Java applications 4.1.4. Starting and stopping -If you are using the Enterprise Edition of Neo4j in embedded mode, you have to create your database with the EnterpriseGraphDatabaseFactory to enable the Enterprise Edition features.
– Guy Coder
Nov 19 at 15:18
2
2
Is it correct to
db.shutdown()
before running a Transaction
on the database?– deHaar
Nov 19 at 11:00
Is it correct to
db.shutdown()
before running a Transaction
on the database?– deHaar
Nov 19 at 11:00
Is the Neo4j graph database a Community or Enterprise version? If it is an Enterprise version then for
GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(p);
change GraphDatabaseFactory
to EnterpriseGraphDatabaseFactory
.– Guy Coder
Nov 19 at 15:15
Is the Neo4j graph database a Community or Enterprise version? If it is an Enterprise version then for
GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(p);
change GraphDatabaseFactory
to EnterpriseGraphDatabaseFactory
.– Guy Coder
Nov 19 at 15:15
Of interest: Neo4j Java Reference - Chapter 4. Using Neo4j embedded in Java applications 4.1.4. Starting and stopping -
If you are using the Enterprise Edition of Neo4j in embedded mode, you have to create your database with the EnterpriseGraphDatabaseFactory to enable the Enterprise Edition features.
– Guy Coder
Nov 19 at 15:18
Of interest: Neo4j Java Reference - Chapter 4. Using Neo4j embedded in Java applications 4.1.4. Starting and stopping -
If you are using the Enterprise Edition of Neo4j in embedded mode, you have to create your database with the EnterpriseGraphDatabaseFactory to enable the Enterprise Edition features.
– Guy Coder
Nov 19 at 15:18
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53373127%2flinking-java-to-neo4j-server%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Is it correct to
db.shutdown()
before running aTransaction
on the database?– deHaar
Nov 19 at 11:00
Is the Neo4j graph database a Community or Enterprise version? If it is an Enterprise version then for
GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(p);
changeGraphDatabaseFactory
toEnterpriseGraphDatabaseFactory
.– Guy Coder
Nov 19 at 15:15
Of interest: Neo4j Java Reference - Chapter 4. Using Neo4j embedded in Java applications 4.1.4. Starting and stopping -
If you are using the Enterprise Edition of Neo4j in embedded mode, you have to create your database with the EnterpriseGraphDatabaseFactory to enable the Enterprise Edition features.
– Guy Coder
Nov 19 at 15:18