java-stellar-sdk icon indicating copy to clipboard operation
java-stellar-sdk copied to clipboard

Not a JSON Object: "problem"

Open lijianl opened this issue 2 years ago • 1 comments

version 0.31.0

07:44:57.547    [OkHttp https://horizon.stellar.org/...] ERROR com.novadax.coin.xlm.WalletXLMServiceImpl -xlm-failure->>{}
shadow.com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Not a JSON Object: "problem"
	at shadow.com.google.gson.Gson.fromJson(Gson.java:939)
	at shadow.com.google.gson.Gson.fromJson(Gson.java:892)
	at shadow.com.google.gson.Gson.fromJson(Gson.java:841)
	at shadow.com.google.gson.Gson.fromJson(Gson.java:813)
	at org.stellar.sdk.requests.SSEStream$StellarEventSourceListener.onEvent(SSEStream.java:202)
	at shadow.okhttp3.internal.sse.RealEventSource.onEvent(RealEventSource.java:111)
	at shadow.okhttp3.internal.sse.ServerSentEventReader.completeEvent(ServerSentEventReader.java:112)
	at shadow.okhttp3.internal.sse.ServerSentEventReader.processNextEvent(ServerSentEventReader.java:69)
	at shadow.okhttp3.internal.sse.RealEventSource.processResponse(RealEventSource.java:80)
	at shadow.okhttp3.internal.sse.RealEventSource.onResponse(RealEventSource.java:54)
	at shadow.okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
	at shadow.okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Not a JSON Object: "problem"
	at shadow.com.google.gson.JsonElement.getAsJsonObject(JsonElement.java:91)
	at org.stellar.sdk.responses.OperationDeserializer.deserialize(OperationDeserializer.java:34)
	at org.stellar.sdk.responses.OperationDeserializer.deserialize(OperationDeserializer.java:20)
	at shadow.com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
	at shadow.com.google.gson.Gson.fromJson(Gson.java:927)
	... 14 common frames omitted

how to solve this

this bug was threw from java sdk, and happens frequently

lijianl avatar Feb 16 '22 08:02 lijianl

question 2: once the onFailure function get the bug upon, the stream will stop listening..

lijianl avatar Feb 16 '22 08:02 lijianl

Same issue

StanislavKozlovsky avatar Nov 07 '22 11:11 StanislavKozlovsky

Let's track it here for the second question.

overcat avatar Nov 07 '23 09:11 overcat

Due to the lack of sufficient debug information (such as transaction hash), and I am unable to reproduce it either, so I have decided to close it. If there are any further issues later on, feel free to reopen it.

overcat avatar Nov 07 '23 12:11 overcat