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
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/...
).
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.