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.










share|improve this question


















  • 2




    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












  • 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

















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.










share|improve this question


















  • 2




    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












  • 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















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.










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 19 at 10:56









Copp

254




254








  • 2




    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












  • 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




    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












  • 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



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

Origin of the phrase “under your belt”?