question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NoSuchMethodError with Gson

See original GitHub issue

I’m getting a NoSuchMethodError when using the JsonParser.parseString(String) method from Google Gson to parse JSON:

final var jsonElement = JsonParser.parseString(Files.readString(updateOperationsFile));

I’m using this command-sequence to start the kernel and download a JAR

!apt update -q
!apt-get install -q openjdk-17-jdk-headless
!curl -L https://github.com/SpencerPark/IJava/releases/download/v1.3.0/ijava-1.3.0.zip -o ijava-kernel.zip
!unzip -o -q ijava-kernel.zip -d ijava-kernel && cd ijava-kernel && python3 install.py --sys-prefix
!jupyter kernelspec list
!curl -L https://oss.sonatype.org/content/repositories/snapshots/io/sirix/sirix-xquery/0.9.6-SNAPSHOT/sirix-xquery-0.9.6-20220209.213554-1218-all.jar -o sirix-xquery.jar

java.lang.NoSuchMethodError: ‘com.google.gson.JsonElement com.google.gson.JsonParser.parseString(java.lang.String)’ at org.sirix.access.trx.node.json.JsonNodeReadOnlyTrxImpl.getUpdateOperations(JsonNodeReadOnlyTrxImpl.java:113)

You can see the error in the following Notebook: https://colab.research.google.com/drive/1NNn1nwSbK6hAekzo1YbED52RI3NMqqbG#scrollTo=RwIAuN1IKtUo

Whenever you execute a cell with a jn:diff-function.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
paulk-asertcommented, Jul 2, 2022

It looks like you already have a PR over in the relevant project (jupyter-jvm-basekernel). If that project is updated, it will be easy to bump the version of that plugin here.

1reaction
paulk-asertcommented, Jul 2, 2022

./gradlew dependencies shows it is an indirect dependency of jupyter-jvm-basekernel which (along with its dependencies) is shaded into the IJava jar:

runtimeClasspath - Runtime classpath of source set 'main'.
+--- io.github.spencerpark:jupyter-jvm-basekernel:2.3.0
|    +--- org.zeromq:jeromq:0.5.1
|    |    \--- eu.neilalexander:jnacl:1.0.0
|    \--- com.google.code.gson:gson:2.8.5
|    ...
Read more comments on GitHub >

github_iconTop Results From Across the Web

0 - Stack Overflow
java.lang.NoSuchMethodError: com.google.gson.Gson.newBuilder()Lcom/google/gson/GsonBuilder; · It looks like the method is only in Gson 2, not ...
Read more >
GsonBuilder.create(): NoSuchMethodError · Issue #1867
Before I use Gson 2.4, I try to upgrade to version 2.8.6 and same error. My source is : GsonBuilder gsb = new...
Read more >
Solved - GSON JsonParser#parseReader() NoSuchMethodError
Hello there, so currently i'm running into a Problem where i can't get Gson to run correctly. I am calling an API, and...
Read more >
java.lang.NoSuchMethodError: com.google.gson.internal.bind ...
NoSuchMethodError : com.google.gson.internal.bind. ... view is broken because of a NoSuchMethodError that I think is based in the artifact-manager-s3-plugin.
Read more >
Search - appsloveworld.com
[Code example]-java.lang.NoSuchMethodError: com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder; · MOST POPULAR · Random Posts · Featured post.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found