mohitsoni / marathon-client

Java API client for Mesosphere's Marathon.
Apache License 2.0
50 stars 89 forks source link

Fixed healthCheck command issue #37

Open sumannewton opened 8 years ago

sumannewton commented 8 years ago

command within healthcheck isn't a String. Its a object as below: { "value": "COMMAND goes here" }

getApps will fail with below exception if at all if any app has command healthcheck: Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 499709 path $.apps[0].healthChecks[0].command at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:187) 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:95) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:183) 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:95) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:183) at com.google.gson.Gson.fromJson(Gson.java:805) at com.google.gson.Gson.fromJson(Gson.java:770) at feign.gson.GsonDecoder.decode(GsonDecoder.java:55) at feign.SynchronousMethodHandler.decode(SynchronousMethodHandler.java:161) ... 11 more Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 499709 path $.apps[0].healthChecks[0].command at com.google.gson.stream.JsonReader.nextString(JsonReader.java:836) at com.google.gson.internal.bind.TypeAdapters$13.read(TypeAdapters.java:358) at com.google.gson.internal.bind.TypeAdapters$13.read(TypeAdapters.java:346) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:95) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:183) ... 25 more

Fixed the above issue.

sumannewton commented 7 years ago

@mohitsoni Please review and merge. This is causing an issue in our application while getting apps.

sumannewton commented 6 years ago

@mohitsoni Any update on this?

mohitsoni commented 6 years ago

@sumannewton I'm no longer maintaining this project, please use: http://github.com/mesosphere/marathon-client