In Android, the following error occurs in the HTTP request: "Your Ed authentication challenge is null ".

Source: Internet
Author: User

 
These two days, I suddenly received the Test Team and told the company that the Android client should be used on some mobile phones with the following exceptions, some of which were running well and were very strange:
1) HttpUtils/getInputStream failed, e: Received authentication challenge is null
 
PS: The application request uses HttpConnection in Java instead of HttpClient.
 
Later, tests on multiple mobile phones showed that such a problem exists and appeared on android v4.04. Later, I checked the information and found that many people encountered similar problems, such:
1) http://d.hatena.ne.jp/Kazzz/20100706/p1
2) http://www.cnblogs.com/slider/archive/2012/07/16/2593816.html
 
In addition, we all use HttpConnection in Java, which occurs when requesting authentication. Later, it was discovered that the server returned a 401 error (for example, when the user name and password are incorrect ). This is also a jdk bug. I found this bug in buglist. But I don't know how to solve it. So I replaced HttpConnection with HttpClient, and the result showed the following exception:
1) W/System. err (18984): java.net. SocketTimeoutException: Read timed out
 
So I began to fall into another trap. After various tests, I found that it was setSoTimeout (params, 0) in HttpClient. I set it to 4 s, later, I changed it to 20 s (this value occasionally causes problems), and then I set it to 0 to solve the problem.
 
It took me too much time to solve this problem... Record it here and give a reference to friends who have encountered the same problem.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.