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 ?


--