neo4j-labs / neosemantics

Graph+Semantics: Import/Export RDF from Neo4j. SHACL Validation, Model mapping and more.... If you like it, please ★ ⇧
https://neo4j.com/labs/neosemantics/
Apache License 2.0
813 stars 141 forks source link

java.lang.NoSuchMethodError: 'com.fasterxml.jackson.core.util.JacksonFeatureSet com.fasterxml.jackson.core.JsonParser.getReadCapabilities()' #259

Open andrea-berling opened 2 years ago

andrea-berling commented 2 years ago

I've encountered this problem while trying to add the neosemantics plugin version 4.4.0.1 to my K8s deployment of a Neo4j causal cluster using the neo4j:4.4.6-enterprise as a base image and installing the plugin with a custom Dockerfile. Basically when the pods start up I get the following output:

Changed password for user 'neo4j'.
Uncaught error from thread [cc-discovery-actor-system-akka.actor.default-dispatcher-10]: 'com.fasterxml.jackson.core.util.JacksonFeatureSet com.fasterxml.jackson.core.JsonParser.getReadCapabilities()', shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[cc-discovery-actor-system]
java.lang.NoSuchMethodError: 'com.fasterxml.jackson.core.util.JacksonFeatureSet com.fasterxml.jackson.core.JsonParser.getReadCapabilities()'
        at com.fasterxml.jackson.databind.DeserializationContext.<init>(DeserializationContext.java:212)
        at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.<init>(DefaultDeserializationContext.java:50)
        at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl.<init>(DefaultDeserializationContext.java:391)
        at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl.createInstance(DefaultDeserializationContext.java:413)
        at com.fasterxml.jackson.databind.ObjectMapper.createDeserializationContext(ObjectMapper.java:4737)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4666)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3690)
        at com.neo4j.causalclustering.discovery.kubernetes.K8sHttpClient.get(K8sHttpClient.java:122)
        at com.neo4j.causalclustering.discovery.kubernetes.K8sHttpClient.getServiceByLabel(K8sHttpClient.java:78)
        at com.neo4j.causalclustering.discovery.KubernetesResolver$K8sRetryHostnameResolver.resolveOnce(KubernetesResolver.java:138)
        at com.neo4j.causalclustering.discovery.RetryingHostnameResolver.lambda$resolve$0(RetryingHostnameResolver.java:41)
        at com.neo4j.causalclustering.discovery.RetryStrategy.apply(RetryStrategy.java:58)
        at com.neo4j.causalclustering.discovery.RetryingHostnameResolver.resolve(RetryingHostnameResolver.java:41)
        at com.neo4j.causalclustering.discovery.KubernetesResolver.resolve(KubernetesResolver.java:56)
        at com.neo4j.causalclustering.discovery.akka.system.ClusterJoiningActor.resolve(ClusterJoiningActor.java:162)
        at com.neo4j.causalclustering.discovery.akka.system.ClusterJoiningActor.join(ClusterJoiningActor.java:120)
        at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:24)
        at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:20)
        at scala.PartialFunction.applyOrElse(PartialFunction.scala:127)
        at scala.PartialFunction.applyOrElse$(PartialFunction.scala:126)
        at akka.japi.pf.UnitCaseStatement.applyOrElse(CaseStatements.scala:20)
        at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:175)
        at akka.actor.Actor.aroundReceive(Actor.scala:539)
        at akka.actor.Actor.aroundReceive$(Actor.scala:537)
        at com.neo4j.causalclustering.discovery.akka.AbstractActorWithTimersAndLogging.akka$actor$Timers$$super$aroundReceive(AbstractActorWithTimersAndLogging.scala:19)
        at akka.actor.Timers.aroundReceive(Timers.scala:55)
        at akka.actor.Timers.aroundReceive$(Timers.scala:40)
        at com.neo4j.causalclustering.discovery.akka.AbstractActorWithTimersAndLogging.aroundReceive(AbstractActorWithTimersAndLogging.scala:19)
        at akka.actor.ActorCell.receiveMessage(ActorCell.scala:614)
        at akka.actor.ActorCell.invoke(ActorCell.scala:583)
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:268)
        at akka.dispatch.Mailbox.run(Mailbox.scala:229)
        at akka.dispatch.Mailbox.exec(Mailbox.scala:241)
        at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
        at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
        at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

After that the Pods error out. It looks like Akka (which is apparently being used as a middleware in the Helm chart I'm using, https://artifacthub.io/packages/helm/neo4j-helm-charts/neo4j-cluster-core) needs a function that is not present in version 2.9.10.x (which is the version of jackson that the neosemantics 4.4.0.1 release ships with) but is instead present in version 2.12.x. I solved the issue by bumping up the version of the jackson dependencies to 2.13.3 (along with adding jackson-core and jackson-mapping as explicit dependencies, as suggested here.

Would it be possible to bump up the version of jackson-databind to address this issue?

forsakendaemon commented 2 years ago

This happens when attempting to import JSON-LD using Neosemantics (4.4.0.1) that installed in Neo4j (4.4.5) by Neo4j Desktop (1.4.15) as well. Looks like these are all the current versions.