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

  1. ,

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

  2. ,

    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 seanford
, 1 year ago
Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive
via GitHub by marcfon
, 1 year ago
Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive
via GitHub by seanford
, 1 year ago
Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive
via GitHub by seanford
, 1 year ago
Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive
via GitHub by smithski
, 1 year ago
Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive
via GitHub by Trevor-Austin
, 1 year ago
Expected a com.g oogle.gson.JsonObject but was com.google.gson.JsonPrimitive
com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive	at com.google.gson.internal.bind.TypeAdapters$35$1.read(TypeAdapters.java:917)	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)	at com.google.gson.Gson.fromJson(Gson.java:879)	at com.google.gson.Gson.fromJson(Gson.java:944)	at com.google.gson.Gson.fromJson(Gson.java:917)	at com.bwssystems.nest.protocol.status.StructureDeserializer.deserialize(StructureDeserializer.java:23)	at com.bwssystems.nest.protocol.status.StructureDeserializer.deserialize(StructureDeserializer.java:14)	at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58)	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)	at com.google.gson.Gson.fromJson(Gson.java:879)	at com.google.gson.Gson.fromJson(Gson.java:844)	at com.google.gson.Gson.fromJson(Gson.java:793)	at com.google.gson.Gson.fromJson(Gson.java:765)	at com.bwssystems.nest.controller.Nest._getStatus(Nest.java:54)	at com.bwssystems.nest.controller.Nest.(Nest.java:45)	at com.bwssystems.NestBridge.NestHome.(NestHome.java:38)	at com.bwssystems.HABridge.HABridge.main(HABridge.java:68)