Skip to content

Null pointer exception when receiving a 404 not found #462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scolemanT2 opened this issue Feb 27, 2014 · 4 comments
Closed

Null pointer exception when receiving a 404 not found #462

scolemanT2 opened this issue Feb 27, 2014 · 4 comments
Assignees
Milestone

Comments

@scolemanT2
Copy link

I've implemented jloop using the 1.4.4 jar file. When I receive a 404 not found I get a null pointer exception :

02-27 11:01:06.639: E/AndroidRuntime(11390): FATAL EXCEPTION: Thread-931
02-27 11:01:06.639: E/AndroidRuntime(11390): java.lang.NullPointerException
02-27 11:01:06.639: E/AndroidRuntime(11390): at com.loopj.android.http.AsyncHttpResponseHandler.postRunnable(AsyncHttpResponseHandler.java:412)
02-27 11:01:06.639: E/AndroidRuntime(11390): at com.loopj.android.http.JsonHttpResponseHandler$2.run(JsonHttpResponseHandler.java:191)
02-27 11:01:06.639: E/AndroidRuntime(11390): at java.lang.Thread.run(Thread.java:856)

Which indicates error at liine 191 of JsonHttpResponseHandler but that file in GIT only has 169 lines in it.

I can get rid of the exception by overriding this onFailure():

@Override
public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
}

in my JsonHttpResponseHandler callback

Here's the 404:

HTTP/1.1 404 Not found: Node 42 could not be found
Date: Thu, 27 Feb 2014 19:00:26 GMT
Server: Apache
X-Powered-By: PHP/5.3.3
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Thu, 27 Feb 2014 19:00:26 +0000
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
ETag: "1393527626"
Access-Control-Allow-Credentials: true
Vary: Accept
Content-Length: 30
Connection: close
Content-Type: application/json
@smarek
Copy link
Member

smarek commented Mar 24, 2014

This NPE is already fixed, this is duplicate to #397
Use latest version from Maven Snapshot (https://oss.sonatype.org/content/repositories/snapshots/) or from github master branch

@smarek smarek closed this as completed Mar 24, 2014
@smarek smarek added this to the 1.4.5 milestone Mar 24, 2014
@smarek smarek self-assigned this Mar 24, 2014
@gongzunpan
Copy link

印象笔记无法提交笔记,原因如下:

本月帐户上传流量已经达到上限。

原消息详情:
来自:Marek Sebera <notifications@github.com>
发送到:gongzunpan.e099425@m.yinxiang.com
全部收件人:loopj/android-async-http <android-async-http@noreply.github.com>
主题:Re: [android-async-http] Null pointer exception when receiving a 404 not found (#462)

为了防止邮件过多,接下来的360分钟内,你将不会收到报错回复。

升级到印象笔记高级帐户,可以发送的邮件数量将从50封提升到200封。
https://app.yinxiang.com/Checkout.action?origin=email%2Dcommerce

  • 印象笔记团队

@azhar-bandri
Copy link

@smarek can you please update the jar as well, for this fix.

@rodmiranda
Copy link

I got different version 1.4.5 snapshots (Jars), like android-async-http-1.4.5.jar, android-async-http-1.4.5-20140324.223512-3.jar and couldn't make it work on Eclipse (latest today). It gives me NoClassDefFoundError AsyncHttpClient.... in runtime only. Is it related to the Dalvik optimizations? Doesn't Eclipe know how to handle it?
Added the com.loopj. package to my project and couldn't get it compiled.

Something weird with this problem. Strugling with this bug for days now. Will be monitoring answers.

@smarek
Copy link
Member

smarek commented Mar 28, 2014

Can you post stacktrace? If it is reasonable, I'll reopen the issue, if it is not fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants