Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

JSON error with a bad wireless connection #888

Copy link
Copy link
@GerardPaligot

Description

@GerardPaligot
Issue body actions

Hello,

I'm developing an GitHub application with AndroidAnnotations. This application isn't very complex and all works fine except when I don't have a good wireless connection on my smartphone.

With this bad connection, I receive a force closed exception with a online request. After that, I won't be able to succeed this request again. I restart the application but the exception come back.

I'm using the GitHub API v3. So, there aren't problems with the JSON.

The stack trace is :

01-14 22:35:16.082: E/AndroidRuntime(9317): FATAL EXCEPTION: pool-1-thread-1
01-14 22:35:16.082: E/AndroidRuntime(9317): Process: fr.univ.lille1.github, PID: 9317
01-14 22:35:16.082: E/AndroidRuntime(9317): org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 13; nested exception is com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 13
01-14 22:35:16.082: E/AndroidRuntime(9317):     at org.springframework.http.converter.json.GsonHttpMessageConverter.readInternal(GsonHttpMessageConverter.java:143)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at org.springframework.http.converter.AbstractHttpMessageConverter.read(AbstractHttpMessageConverter.java:147)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:76)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:655)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:641)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:484)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:447)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:422)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at fr.univ.lille1.github.network.RestGithub_.getFollowings(RestGithub_.java:55)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at fr.univ.lille1.github.FollowingActivity.backgroundRepository(FollowingActivity.java:36)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at fr.univ.lille1.github.FollowingActivity_.access$101(FollowingActivity_.java:27)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at fr.univ.lille1.github.FollowingActivity_$3.execute(FollowingActivity_.java:130)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at org.androidannotations.api.BackgroundExecutor$Task.run(BackgroundExecutor.java:302)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at java.lang.Thread.run(Thread.java:841)
01-14 22:35:16.082: E/AndroidRuntime(9317): Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 13
01-14 22:35:16.082: E/AndroidRuntime(9317):     at com.google.gson.Gson.fromJson(Gson.java:806)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at com.google.gson.Gson.fromJson(Gson.java:734)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at org.springframework.http.converter.json.GsonHttpMessageConverter.readInternal(GsonHttpMessageConverter.java:140)
01-14 22:35:16.082: E/AndroidRuntime(9317):     ... 19 more
01-14 22:35:16.082: E/AndroidRuntime(9317): Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 13
01-14 22:35:16.082: E/AndroidRuntime(9317):     at com.google.gson.stream.JsonReader.expect(JsonReader.java:339)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:306)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:79)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
01-14 22:35:16.082: E/AndroidRuntime(9317):     at com.google.gson.Gson.fromJson(Gson.java:795)
01-14 22:35:16.082: E/AndroidRuntime(9317):     ... 21 more
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.