com.google.gson.JsonSyntaxException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Amy Mitchell - Google+
    via by Unknown author,
  • When we have a test result to be parsed by mocha and this results have duration that are non-integer, the build will fail with the error below: {code} com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 3.3382 at line 1 column 39 at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:232) at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:222) 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.google.gson.Gson.fromJson(Gson.java:790) at com.google.gson.Gson.fromJson(Gson.java:729) at com.atlassian.bamboo.plugins.nodejs.tasks.mocha.parser.MochaReportCollector.collect(MochaReportCollector.java:36) at com.atlassian.bamboo.build.test.TestCollationServiceImpl$1$1.run(TestCollationServiceImpl.java:139) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NumberFormatException: Expected an int but was 3.3382 at line 1 column 39 at com.google.gson.stream.JsonReader.nextInt(JsonReader.java:1192) at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:230) ... 17 more {code} Most test results are in milliseconds and this makes parsing impossible
    via by Sultan Maiyaki [Atlassian],
  • When we have a test result to be parsed by mocha and this results have duration that are non-integer, the build will fail with the error below: {code} com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 3.3382 at line 1 column 39 at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:232) at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:222) 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.google.gson.Gson.fromJson(Gson.java:790) at com.google.gson.Gson.fromJson(Gson.java:729) at com.atlassian.bamboo.plugins.nodejs.tasks.mocha.parser.MochaReportCollector.collect(MochaReportCollector.java:36) at com.atlassian.bamboo.build.test.TestCollationServiceImpl$1$1.run(TestCollationServiceImpl.java:139) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NumberFormatException: Expected an int but was 3.3382 at line 1 column 39 at com.google.gson.stream.JsonReader.nextInt(JsonReader.java:1192) at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:230) ... 17 more {code} Most test results are in milliseconds and this makes parsing impossible
    via by Sultan Maiyaki [Atlassian],
  • NFE when debugging in delve
    via GitHub by dlsniper
    ,
  • GitHub comment 2707#237215556
    via GitHub by keith198
    ,
  • Exception
    via GitHub by glaubermmferreira
    ,
    • com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 3559677043409748 at line 1 column 40479 path $.favorites[12].tags[0].id at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:241) at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:231) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:103) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:196) 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:103) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:196) 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:103) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:196) at com.google.gson.Gson.fromJson(Gson.java:810) at com.google.gson.Gson.fromJson(Gson.java:775) at com.google.gson.Gson.fromJson(Gson.java:724) at com.google.gson.Gson.fromJson(Gson.java:696) at com.wenming.weiswift.entity.list.FavoriteList.parse(FavoriteList.java:45) at com.wenming.weiswift.mvp.model.imp.FavoriteListModelImp$3.onComplete(FavoriteListModelImp.java:87) at com.sina.weibo.sdk.net.AsyncWeiboRunner$RequestRunner.onPostExecute(AsyncWeiboRunner.java:152) at com.sina.weibo.sdk.net.AsyncWeiboRunner$RequestRunner.onPostExecute(AsyncWeiboRunner.java:1) at android.os.AsyncTask.finish(AsyncTask.java:632) at android.os.AsyncTask.access$600(AsyncTask.java:177) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5476) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NumberFormatException: Expected an int but was 3559677043409748 at line 1 column 40479 path $.favorites[12].tags[0].id at com.google.gson.stream.JsonReader.nextInt(JsonReader.java:1178) at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:239) ... 32 more

    Users with the same issue

    Unknown visitor2 times, last one,