mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

HTTP exception

Open peterneubauer opened this issue 11 years ago • 11 comments

I got this once:

Fatal Exception: java.lang.NullPointerException: String cannot be null.
   at com.mapbox.mapboxsdk.http.HTTPContext$HTTPRequest.nativeOnFailure(HTTPContext.java)
   at com.mapbox.mapboxsdk.http.HTTPContext$HTTPRequest.onFailure(HTTPContext.java:92)
   at com.mapbox.mapboxsdk.http.HTTPContext$HTTPRequest.onResponse(HTTPContext.java:103)
   at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:168)
   at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
   at java.lang.Thread.run(Thread.java:818)

peterneubauer avatar Nov 09 '15 11:11 peterneubauer

@ljbade, @zugaldia: Is this something that will be resolved with the refactor for offline or needs to investigated further?

tobrun avatar Nov 13 '15 08:11 tobrun

This definitely looks like something that will be addressed once https://github.com/mapbox/mapbox-gl-native/issues/2400 gets merged. Worth re-testing the code with those changes.

zugaldia avatar Nov 16 '15 19:11 zugaldia

@zugaldia If I recall you found the same crash? We added a null check to JNI for that.

ljbade avatar Nov 16 '15 22:11 ljbade

@ljbade That's correct.

zugaldia avatar Nov 17 '15 02:11 zugaldia

I was not able to reproduce this error and seeing the discussion above between @zugaldia and @ljbade. I'm calling this resolved for now. Reopen if this occurs again.

tobrun avatar Jan 12 '16 08:01 tobrun

Also, worth mentioning that we recently landed some better HTTP log messages to help debug these issues: https://github.com/mapbox/mapbox-gl-native/commit/d2b2336a9efc00978950cd3ee9d4d0af6ad7f1bf

zugaldia avatar Jan 13 '16 16:01 zugaldia

@tobrun It occured after I upgrade to version 3.0.0. And it happened many time when network doesn't stable.

01-19 16:52:43.698 30050-30146/? D/com.mapbox.mapboxsdk.http.HTTPContext$HTTPRequest: onFailure: null
01-19 16:52:43.709 30050-30126/? E/mbgl: {Map}[Setup]: loading style failed: 
01-19 16:52:43.732 30050-30146/? E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
                                                   Process: com.myapp, PID: 30050
                                                   java.lang.NullPointerException: String cannot be null.
                                                       at com.mapbox.mapboxsdk.http.HTTPContext$HTTPRequest.nativeOnFailure(Native Method)
                                                       at com.mapbox.mapboxsdk.http.HTTPContext$HTTPRequest.onFailure(HTTPContext.java:94)
                                                       at com.mapbox.mapboxsdk.http.HTTPContext$HTTPRequest.onResponse(HTTPContext.java:105)
                                                       at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:168)
                                                       at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
                                                       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                       at java.lang.Thread.run(Thread.java:818)

vfaSonnt avatar Jan 19 '16 10:01 vfaSonnt

@vfaSonnt thank you for reaching out and reporting your problem. This problem you are mentioning and the problem described here are a bit different. We are going to test/patch/fix your problem in https://github.com/mapbox/mapbox-gl-native/issues/3465.

tobrun avatar Jan 20 '16 12:01 tobrun

@tobrun does this https://github.com/mapbox/mapbox-gl-native/issues/3692 is same with my problem?

vfaSonnt avatar Feb 17 '16 10:02 vfaSonnt

@vfaSonnt: I believe it is the same

tobrun avatar Feb 17 '16 15:02 tobrun

Thank you very much.

vfaSonnt avatar Feb 18 '16 02:02 vfaSonnt