com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: BEGIN_OBJECT expected, but met STRING Scopes: INSIDE_OBJECT>NAME>INSIDE_OBJECT>INSIDE_EMBEDDED_ARRAY>INSIDE_OBJECT Closed tags: 'Class3'/3 Token: null Tokens queue: null Values queue: , null

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,

Your json input might be invalid. Try checking it in a validator like https://jsonlint.com

,

Your custom gson deserializer might have a bug. Try to write a unit test that checks proper deserialization of only that class by forging a json that contains a single field of that type.

Solutions on the web

via GitHub by andrewgaul
, 11 months ago
java.lang.IllegalStateException: BEGIN_OBJECT expected, but met STRING Scopes: INSIDE_OBJECT>NAME>INSIDE_OBJECT>INSIDE_EMBEDDED_ARRAY>INSIDE_OBJECT Closed tags: 'Class3'/3 Token: null Tokens queue: null Values queue: , null
via Stack Overflow by Nambi
, 1 year ago
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 147 path $.info[0].StartTime
via Stack Overflow by d4v1dv00
, 2 years ago
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 206022 path $.data[49].category
via GitHub by VladimirBogomolov
, 4 months ago
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at path $[3].exports
via Stack Overflow by Alexei
, 1 month ago
java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 113 column 17 path $[0].offers[0].catalog.images
via Stack Overflow by thenewOne1234567890
, 9 months ago
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 4773 path $[5].image.data
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: BEGIN_OBJECT expected, but met STRING Scopes: INSIDE_OBJECT>NAME>INSIDE_OBJECT>INSIDE_EMBEDDED_ARRAY>INSIDE_OBJECT Closed tags: 'Class3'/3 Token: null Tokens queue: null Values queue: , null
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:172)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:172)
at com.stanfy.gsonxml.GsonXml.fromXml(GsonXml.java:96)
at com.stanfy.gsonxml.GsonXml.fromXml(GsonXml.java:66)
at com.stanfy.gsonxml.GsonXml.fromXml(GsonXml.java:52)
at com.stanfy.gsonxml.GsonXml.fromXml(GsonXml.java:42)
at com.stanfy.gsonxml.test.ListsTest.testAclXml(ListsTest.java:303)

Users with the same issue

2 times, 1 month ago
7 times, 6 months ago
Once, 7 months ago
59 times, 1 year ago
5 times, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.