java.lang.IllegalStateException: Expected BEGIN_OBJECT but was NULL

GitHub | BishopGIS | 3 months ago
  1. 0

    GitHub comment 482#244009871

    GitHub | 3 months ago | BishopGIS
    java.lang.IllegalStateException: Expected BEGIN_OBJECT but was NULL
  2. 0

    IllegalStateException: Expected BEGIN_OBJECT but was STRING while trying to create a list of Objects from a Complex Json file

    Stack Overflow | 10 months ago | Asif Billa
    com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING
  3. 0

    using jclouds-example compute-basic: https://github.com/jclouds/jclouds-examples/tree/master/compute-basics with command line: java \ -Dopenstack-nova.image-id=RegionOne/<image ID> \ -Dopenstack-nova.login-user=ubuntu \ -Djclouds.trust-all-certs=true \ -Djclouds.keystone.credential-type=passwordCredentials \ -Dopenstack-nova.endpoint=https://<openstack endpoint host>/v2.0 \ -jar target/compute-basics-jar-with-dependencies.jar \ openstack-nova <tenant>:<username> <password> mygroup add Command fails with exception: {noformat} - no jclouds.zones configured for provider openstack-nova - >> invoking server:list - Sending request 811507394: GET http://<host>/v2/<stuff>/servers/detail HTTP/1.1 - >> GET http://<host>/v2/<stuff>/servers/detail HTTP/1.1 - >> Accept: application/json - >> X-Auth-Token: <redacted> - Receiving response 811507394: HTTP/1.1 200 OK - << HTTP/1.1 200 OK - << Date: Sat, 03 May 2014 05:36:11 GMT - << Connection: keep-alive - << X-Compute-Request-Id: req-30c4d178-ac5f-4f86-8fc3-9dbd10f593ab - << Content-Type: application/json - << Content-Length: 1503 - << "{"servers": [{"status": "ACTIVE", "updated": "2014-05-03T00:45:10Z", "hostId": "cfcfe7bbd3568725754d4cbf500668e0c3890c3f722d322b219559bd", "addresses": {"<tenantid>": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:46:45:df", "version": 4, "addr": "10.10.3.2", "OS-EXT-IPS:type": "fixed"}, {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:46:45:df", "version": 4, "addr": "<ipaddr>", "OS-EXT-IPS:type": "floating"}]}, "links": [{"href": "http://<hostandport>/v2/<stuff>/servers/6aa6bb89-d9ef-4647-982a-803eee53f573", "rel": "self"}, {"href": "http://<hostandport>/<Stuff>/servers/6aa6bb89-d9ef-4647-982a-803eee53f573", "rel": "bookmark"}], "key_name": "foo-test", "image": "", "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-SRV-USG:launched_at": "2014-05-03T00:45:09.000000", "flavor": {"id": "3", "links": [{"href": "http://<hostandport>/<stuff>/flavors/3", "rel": "bookmark"}]}, "id": "6aa6bb89-d9ef-4647-982a-803eee53f573", "security_groups": [{"name": "default"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "FOO", "user_id": "<username>", "name": "<hostname>", "created": "2014-05-03T00:44:12Z", "tenant_id": "<stuff>", "OS-DCF:diskConfig": "MANUAL", "os-extended-volumes:volumes_attached": [{"id": "<stuff>"}], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "metadata": {}}]}" - Error parsing input com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:181) ~[compute-basics-jar-with-dependencies.jar:na] at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$ParameterReader.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:263) ~[compute-basics-jar-with-dependencies.jar:na] at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:175) ~[compute-basics-jar-with-dependencies.jar:na] at com.google.gson.Gson.fromJson(Gson.java:803) ~[compute-basics-jar-with-dependencies.jar:na] at com.google.gson.Gson.fromJson(Gson.java:868) ~[compute-basics-jar-with-dependencies.jar:na] at com.google.gson.Gson$1.deserialize(Gson.java:126) ~[compute-basics-jar-with-dependencies.jar:na] at org.jclouds.openstack.nova.v2_0.config.NovaParserModule$ServerAdapter.deserialize(NovaParserModule.java:129) ~[compute-basics-jar-with-dependencies.jar:na] at org.jclouds.openstack.nova.v2_0.config.NovaParserModule$ServerAdapter.deserialize(NovaParserModule.java:124) ~[compute-basics-jar-with-dependencies.jar:na] at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58) ~[compute-basics-jar-with-dependencies.jar:na] at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$IterableTypeAdapter.readAndBuild(NullFilteringTypeAdapterFactories.java:92) ~[compute-basics-jar-with-dependencies.jar:na] at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$IterableTypeAdapter.read(NullFilteringTypeAdapterFactories.java:84) ~[compute-basics-jar-with-dependencies.jar:na] at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$IterableTypeAdapter.read(NullFilteringTypeAdapterFactories.java:63) ~[compute-basics-jar-with-dependencies.jar:na] at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$ParameterReader.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:263) ~[compute-basics-jar-with-dependencies.jar:na] at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:175) ~[compute-basics-jar-with-dependencies.jar:na] at com.google.gson.Gson.fromJson(Gson.java:803) ~[compute-basics-jar-with-dependencies.jar:na] at com.google.gson.Gson.fromJson(Gson.java:768) ~[compute-basics-jar-with-dependencies.jar:na] at com.google.gson.Gson.fromJson(Gson.java:717) ~[compute-basics-jar-with-dependencies.jar:na] at org.jclouds.json.internal.GsonWrapper.fromJson(GsonWrapper.java:45) ~[compute-basics-jar-with-dependencies.jar:na] at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:84) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:78) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:64) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:44) [compute-basics-jar-with-dependencies.jar:na] at com.google.common.base.Functions$FunctionComposition.apply(Functions.java:216) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.invoke(InvokeSyncToAsyncHttpMethod.java:129) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.apply(InvokeSyncToAsyncHttpMethod.java:95) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.rest.internal.InvokeSyncToAsyncHttpMethod.apply(InvokeSyncToAsyncHttpMethod.java:56) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117) [compute-basics-jar-with-dependencies.jar:na] at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87) [compute-basics-jar-with-dependencies.jar:na] at com.sun.proxy.$Proxy80.listInDetail(Unknown Source) [na:na] at org.jclouds.openstack.nova.v2_0.compute.NovaComputeServiceAdapter.listNodes(NovaComputeServiceAdapter.java:205) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listDetailsOnNodesMatching(AdaptingComputeServiceStrategies.java:123) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listNodes(AdaptingComputeServiceStrategies.java:113) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet.getNextNames(CreateNodesWithGroupEncodedIntoNameThenAddToSet.java:194) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet.execute(CreateNodesWithGroupEncodedIntoNameThenAddToSet.java:123) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.openstack.nova.v2_0.compute.strategy.ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet.execute(ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet.java:148) [compute-basics-jar-with-dependencies.jar:na] at org.jclouds.compute.internal.BaseComputeService.createNodesInGroup(BaseComputeService.java:215) [compute-basics-jar-with-dependencies.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_55] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_55] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_55] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_55] at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37) [compute-basics-jar-with-dependencies.jar:na] at com.sun.proxy.$Proxy59.createNodesInGroup(Unknown Source) [na:na] at org.jclouds.examples.compute.basics.MainApp.main(MainApp.java:169) [compute-basics-jar-with-dependencies.jar:na] Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at com.google.gson.internal.bind.JsonTreeReader.expect(JsonTreeReader.java:139) ~[compute-basics-jar-with-dependencies.jar:na] at com.google.gson.internal.bind.JsonTreeReader.beginObject(JsonTreeReader.java:70) ~[compute-basics-jar-with-dependencies.jar:na] at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:167) ~[compute-basics-jar-with-dependencies.jar:na] ... 42 common frames omitted {noformat} It looks like the JSON schema is not appropriate? This version of OpenStack seems pretty old.. am I doing something wrong?

    Apache's JIRA Issue Tracker | 3 years ago | Andrew Ruef
    com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Improve docs about @Consumer without root

    GitHub | 2 years ago | nykolaslima
    br.com.caelum.vraptor.view.ResultException: Unable to deserialize data
  6. 0

    Querying _all_docs gives stack trace.

    GitHub | 11 months ago | buckett
    com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Expected BEGIN_OBJECT but was NULL

      at android.util.JsonReader.expect()
    2. Android Platform
      JsonReader.beginObject
      1. android.util.JsonReader.expect(JsonReader.java:310)
      2. android.util.JsonReader.beginObject(JsonReader.java:293)
      2 frames
    3. com.nextgis.maplib
      VectorLayer.createFromGeoJson
      1. com.nextgis.maplib.datasource.GeoGeometryFactory.fromJsonStream(GeoGeometryFactory.java:69)
      2. com.nextgis.maplib.util.GeoJSONUtil.readGeoJSONFeature(GeoJSONUtil.java:484)
      3. com.nextgis.maplib.util.GeoJSONUtil.createLayerFromGeoJSONStream(GeoJSONUtil.java:434)
      4. com.nextgis.maplib.map.VectorLayer.createFromGeoJson(VectorLayer.java:396)
      4 frames
    4. com.nextgis.maplibui
      LayerFillService$2.run
      1. com.nextgis.maplibui.service.LayerFillService$VectorLayerFillTask.execute(LayerFillService.java:390)
      2. com.nextgis.maplibui.service.LayerFillService$2.run(LayerFillService.java:253)
      2 frames
    5. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:841)
      1 frame