Protocol exception : too many redirects

by steVe » Tue, 09 Mar 2010 01:44:08 GMT


Sponsored Links
 Hi All,

I get this protocol exception error when I try to read a rss feed. Its
loading fine on the emulator. But when I test on my device (Droid), it
throws the below error.

---------------------------------------------------
03-08 12:29:25.210: ERROR/AndroidRuntime(5108): Caused by:
java.net.ProtocolException: Too many redirects
03-08 12:29:25.210: ERROR/AndroidRuntime(5108):     at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.doRequestInternal(HttpURLConnection.java:
1626)
03-08 12:29:25.210: ERROR/AndroidRuntime(5108):     at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.doRequest(HttpURLConnection.java:
1551)
03-08 12:29:25.210: ERROR/AndroidRuntime(5108):     at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:
1052)
03-08 12:29:25.210: ERROR/AndroidRuntime(5108):     at
com.aol.engadget.parser.BaseFeedParser.getInputStream(BaseFeedParser.java:
45)
03-08 12:29:25.210: ERROR/AndroidRuntime(5108):     ... 9 more
---------------------------------------------------

It stops here on getInputStream.

At the same time I am reading another two feeds from the same server.
It loads and parses fine...

Here is the code

Xml.parse(this.getInputStream(), Xml.Encoding.UTF_8,
root.getContentHandler());

protected InputStream getInputStream() {
                try {
                        URLConnection feedCon = feedUrl.openConnection();

                        return feedCon.getInputStream();
                } catch (IOException e) {
                        throw new RuntimeException(e);
                }
        }


Am I doing anything wrong ? Or is it a bug ?


--



Other Threads

1. Changing a Back button press to Home button press

This won't work. You just cannot do this.






-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~

2. Why does my EditText hint have different font spacing?

Hi,
my activity screen has 3 EditText's for changing the password.
Somehow the hint on the "oldPassword" has different font spacing then
the other two.

I have not changed any properties of the EditText in the Activity
code.

I'm sure it's something obvious, I just don't see it.

Thanks.

Here is the layout:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/changePasswordTextScroller"
android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:fillViewport="true">
        <LinearLayout android:layout_width="fill_parent"
                android:layout_height="fill_parent" 
android:orientation="vertical"
                android:padding="10dip">
                <TextView android:id="@+id/changePasswordText"
                        android:layout_width="wrap_content"
android:layout_height="wrap_content"
                        android:text="@string/changePasswordText" 
android:textSize="20sp"
                        android:textColor="?android:attr/textColorSecondary"
                        android:lineSpacingMultiplier="0.92"
                        android:paddingBottom="10dip" />

                <EditText android:id="@+id/oldPassword"
                    android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:password="true"
            android:layout_marginBottom="20dip"
            android:hint="@string/oldPassword" />

                <ca.heraconsulting.android.secretbox.NewPassword
                        android:id="@+id/newPassword" 
android:layout_width="fill_parent"
                        android:layout_height="wrap_content" />

                <LinearLayout android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
android:orientation="horizontal"
                        android:layout_marginTop="20dip">
                        <Button android:id="@+id/changePasswordOk" 
android:enabled="false"
                                android:text="@android:string/ok"
android:layout_width="fill_parent"
                                android:layout_height="wrap_content" 
android:layout_weight="1" />
                        <Button android:id="@+id/changePasswordCancel"
android:text="@android:string/cancel"
                                android:layout_width="fill_parent"
android:layout_height="wrap_content"
                                android:layout_weight="1" />
                </LinearLayout>
        </LinearLayout>
</ScrollView>

--~--~---------~--~----~------------~-------~--~----~

3. Setting internal storage in the AVD

4. Getting "failed to copy 'content' to '/sdcard/content': Read only file system on donut compilation.

5. GLSurfaceView does not invoke OnKeyDown(...)

6. Don't receive intent

7. Get GPS time/date