gitlab4j-api icon indicating copy to clipboard operation
gitlab4j-api copied to clipboard

NoSuchMethod com.fasterxml.jackson.core.JsonParser.getReadCapabilities()

Open MaxMichel2 opened this issue 3 months ago • 3 comments

When using the latest version in a Kotlin Android application, I get this error when using the TagsApi

I'm not sure why and I suspect there may be an issue within the library.

Here is the stacktrace :

Caused by: java.lang.NoSuchMethodError: 'com.fasterxml.jackson.core.util.JacksonFeatureSet com.fasterxml.jackson.core.JsonParser.getReadCapabilities()'
	at com.fasterxml.jackson.databind.DeserializationContext.<init>(DeserializationContext.java:227)
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.<init>(DefaultDeserializationContext.java:51)
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl.<init>(DefaultDeserializationContext.java:413)
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl.createInstance(DefaultDeserializationContext.java:442)
	at com.fasterxml.jackson.databind.ObjectMapper.createDeserializationContext(ObjectMapper.java:4980)
	at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4955)
	at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:3281)
	at org.gitlab4j.api.utils.JacksonJson.toJsonNode(JacksonJson.java:389)
	at org.gitlab4j.api.GitLabApiException.<init>(GitLabApiException.java:79)
	at org.gitlab4j.api.AbstractApi.validate(AbstractApi.java:784)
	at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:262)
	at org.gitlab4j.api.Pager.<init>(Pager.java:100)
	at org.gitlab4j.api.TagsApi.getTags(TagsApi.java:82)
	at org.gitlab4j.api.TagsApi.getTags(TagsApi.java:40)

MaxMichel2 avatar Oct 31 '25 13:10 MaxMichel2

After some digging around in my project, I have found that the issue occurs since we migrated to using convention plugins instead of using the buildSrc directory in our project.

This helps to identify a reproducing scenario but I'm a little lost as to what actually changes for Jackson to break with this.

There were also changes from target JVM from 11 to 17 but I'm not sure how impactful this could be

MaxMichel2 avatar Oct 31 '25 16:10 MaxMichel2

Which gitlab4j version are you using? Which jackson version are you using?

Please share the dependency tree of your project.

jmini avatar Nov 11 '25 14:11 jmini

Hello,

I'm using GitLab4J version 6.0.1 and not using Jackson.

The Jackson version is the one included with Gitlab4J.

In terms of dependency tree, I am unable to provide it at this time but will try to get it to you soon.

For context, I am using Gitlab4J in a convention plugin in an Kotlin Multiplatform project. The plugin is located in a build-logic folder and a custom Gradle task using Gitlab4J is within a package in this folder.

An example of the structure can be found here

The Now In Android project also contains a build-logic folder which has gradle tasks too.

I haven't tested cloning this repo and adding my task and implementation details to check the reproducability in this case but even if I did, it wouldn't explain the issue I am having and why it arises.

MaxMichel2 avatar Nov 11 '25 15:11 MaxMichel2