java.net.HttpURLConnection throws "Received authentication challenge is null"

by Matthias » Mon, 31 Aug 2009 20:57:58 GMT


Sponsored Links
 I am using HttpURLConnection to send a GET request to a server. Upon
reading the response code, the Android implementation of
HttpURLConnection.doRequestInternal() throws an exception:

"java.io.IOException: Received authentication challenge is null"

I don't even get what the error is trying to tell me. I write an OAuth
param string to the Authorization header, but this works fine on other
occasions. There is nothing peculiar about my request apart from that.

Any idea what this means, what is causing this and how to get around
it? This works fine with Sun's Java implementation, so I guess it's a
problem with Apache Harmony?

Thanks!
Matthias
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. issue with dynamic Multi selection alter dialog

hi there,

i wanted to create a dynamic multi selection alert dialog, currently
it only supports for hard coded values i think ?... i have tried
several ways and very much unsuccessful till now ..

i am fetching the values in JSON format and converting to JSONArray.
but how to input this to builder.setMultiChoiceItems, because it takes
only itemId from xml, cursor, or charsequence. i tried all ways i can
think of for chaging the array to charsequence.. eclipse did not
showed the error but app crashed in android throwing the cast
exception ...

below is the code, any help / suggestion would highly help !!
thankyou!.. (i am new to both java and andriod)


                                Button buttonFriends = (Button)
findViewById(R.id.buttonFriends);

                                JSONObject friends =
jObject.getJSONObject("friends");
                                JSONArray friendsArray =
friends.names();
                               CharSequence[] friendsNames = null;
                                for (int i=0; i <
friendsArray.length(); i++) {
        
if(friends.getString(friendsArray.getString(i)) != null) {
                                                //friendsNames[i] =
friends.getString(friendsArray.getString(i));
                                        }
                                }


                                  buttonFriends.setOnClickListener(new
OnClickListener() {

                                                @Override
                                                public void onClick(View arg0) {
                                                        // TODO Auto-generated 
method stub



                                                        AlertDialog.Builder 
builder = new
AlertDialog.Builder(checkin.this);
                                                        
builder.setTitle("Select your friends");
                                                        
builder.setMultiChoiceItems(friendsNames, null, new
DialogInterface.OnMultiChoiceClickListener() {

                                                                @Override
                                                                public void 
onClick(DialogInterface arg0, int arg1,
                                                                                
boolean arg2) {
                                                                        // TODO 
Auto-generated method stub

                                                                }
                                                        });
                                                        AlertDialog alert = 
builder.create();
                                                        alert.show();
                                                }

                                        });

-- 

2. How to create kind of admob banner or scrolling text?

Use a RelativeLayout for your app and a specific layout aligned on
bottom of your main layout.
So you're banner is based at the bottom :)
Now to scrolling a text inside this banner : use animation, it's the
simplest.

Best




-- 

3. HttpUrlConnection and Sleeping Phones

4. how to change the background of the menuitem

5. Do scheduled alarms persist between app upgrades?

6. Froyo Wi-Fi hotspot mode and server apps

7. No value being returned with ksoap calling web service