com.google.gson.JsonSyntaxException

java.lang.IllegalStateException: BEGIN_OBJECT expected, but met STRING


Solutions on the web593

Solution icon of github
java.lang.IllegalStateException: BEGIN_OBJECT expected, but met STRING

Solution icon of github
via GitHub by ssuukk
, 7 months ago
java.lang.IllegalStateException: NAME expected, but met BEGIN_OBJECT

Solution icon of github
via GitHub by ssuukk
, 7 months ago
java.lang.IllegalStateException: NAME expected, but met STRING

Solution icon of stackoverflow
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT

Solution icon of github
via GitHub by sabrinawilske
, 7 months ago
java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT

Solution icon of github
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING

Solution icon of github
java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT

Solution icon of github
java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT

Solution icon of apache
via Apache's JIRA Issue Tracker by Andrew Ruef, 1 year ago
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING

Solution icon of stackoverflow
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING

Stack trace

  • com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: BEGIN_OBJECT expected, but met STRING at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176) 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.google.gson.Gson.fromJson(Gson.java:803) at com.stanfy.gsonxml.GsonXml.fromXml(GsonXml.java:92) 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.cybertrader.master.message.fixml2.GsonXmlTest.main(GsonXmlTest.java:31) Caused by: java.lang.IllegalStateException: BEGIN_OBJECT expected, but met STRING at com.stanfy.gsonxml.XmlReader.expect(XmlReader.java:137) at com.stanfy.gsonxml.XmlReader.beginObject(XmlReader.java:143) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:165) ... 11 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.