Neo4j “No dependency satisfies type class org.neo4j.kernel.api.index.SchemaIndexProvider”

后端 未结 2 483
南方客
南方客 2021-01-15 01:30

Neo4j Community 2.3.3 Linux (Ubuntu 14.04)

Trying to run a Java app which consumes a Kafka topic, process its messages while querying Neo4j, and writes them to anoth

相关标签:
2条回答
  • 2021-01-15 01:39

    In my case (Neo4j Shell Tools 3.0.3, Gradle 2.13), adding mergeServiceFiles() was the key for resolving this issue:

    plugins { id "com.github.johnrengelman.shadow" version "1.2.3" }
    
    shadowJar {
        classifier = 'fat'
        mergeServiceFiles()
        manifest { attributes 'Main-Class': '...' }
    }
    

    There was no need to specify the exact file (META-INF/...).

    0 讨论(0)
  • 2021-01-15 01:40

    My suspicion is that you don't have the META-INF/services/org.neo4j.kernel.extension.KernelExtensionFactory files in your jar correctly. Internally Neo4j uses JVM's ServiceLoader to load its components.

    See https://github.com/neo4j/neo4j/blob/2.3/community/lucene-index/src/main/resources/META-INF/services/org.neo4j.kernel.extension.KernelExtensionFactory for the potentially missing piece.

    I assume the right way to solve this is not by changing Gradle's default jar task, instead use a plugin that handles META-INF files correctly. I've made some good experiences with the shadow plugin.

    0 讨论(0)
提交回复
热议问题