commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@bluewin.ch>
Subject Re: HttpClient: Maximum redirects (100) exceeded
Date Wed, 07 Apr 2004 22:25:39 GMT
Ahh. Silly me. You are using HTTPS the whole idea of which to provide
transport security. 

You may try another trick. Flush all the cookies that your browser
currently has, hit the site, and see what cookies show up in the browser
cache after that and most importantly what attributes those cookies bear
(especially the version attribute if present)

Oleg


On Thu, 2004-04-08 at 00:18, Oleg Kalnichevski wrote:
> Stephen,
> The problem is clearly related to the session management on the server
> side. The redirects problem appears to be merely a side-effect of
> HttpClient inability to pass the session data the way the server expects
> it. 
> 
> If you were able to capture the data transferred by the browser, I
> believe I would be able to figure what needs to be done to make
> HttpClient successfully emulate that kind of session management
> 
> Oleg
> 
> 
> On Wed, 2004-04-07 at 23:59, Stephen Charles Huey wrote:
> > Hey Oleg, thanks for the tip.  I added the second line below to my code:
> > 
> >         HttpClient oClient = new HttpClient();      
> >         oClient.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);   
> > 
> > However, I still exceed the maximum number of redirects.  
> > 
> > I found a website that lets you enter in a URL and it will trace all the
> > redirects for you, but it doesn't work for HTTPS sites like this one.  I
> > wish there was a way in IE 6 or Firefox to get a list of all the
> > redirects that the web browser followed to get somewhere, because somehow
> > those browsers are able to get there, and I'd like to see how.  I guess
> > it could be what you're suggesting...having trouble getting the cookies
> > set appropriately?  
> > 
> > Thanks,
> > Stephen
> > 
> > 
> > ----- Original message -----
> > From: "Oleg Kalnichevski" <olegk@bluewin.ch>
> > To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
> > Date: Wed, 07 Apr 2004 23:20:04 +0200
> > Subject: Re: HttpClient:  Maximum redirects (100) exceeded
> > 
> > Stephen,
> > Try two things:
> > 
> > (1) disable stale connection check (has nothing to do wit the issue but
> > should improve performance and generate fewer scary warnings in the log
> > 
> > (2) Use browser compatibility cookie policy
> > 
> > and see if that makes any difference
> > 
> > Oleg
> > 
> > 
> > 
> > On Wed, 2004-04-07 at 21:01, Stephen Charles Huey wrote:
> > > I hope I didn't scare any knowledgable folks off with too much info in my
> > > last email.  Someone suggested I run a wire trace log, so I did, but I'm
> > > wondering if this one part might be the clincher:
> > > 
> > > 2004/04/07 09:38:59:306 CDT [DEBUG] HttpMethodBase - -Redirecting from
> > > 'https://www.fedex.com:443/swab/AddressMain.do' to
> > > 'https://www.fedex.com/cgi-bin/ssoswab;SWABSESSIONID=A0S85B1LbPcoaGqyWhaC7m4x6gxJ3ptWQa2gGiFlp1I1DoPWJA0W!1270069690!wwls9.sac.fedex.com!7998!7002?cc_lang=us_en&returnurl=https://www.fedex.com/swab/AddressMain.do?appID%3DFSM%26cc_lang%3Dus%26cc%3Dus%26language%3Dus%26sType%3D%26gnd_flag%3DY%26dgalc%3DN
> > > 
> > > 2004/04/07 09:38:59:446 CDT [DEBUG] HttpMethodBase - -Should close
> > > connection in response to Connection: close
> > > 
> > > 
> > > I know HttpClient doesn't redirect to different domains, but this
> > > shouldn't count as another domain...I'm wondering if it's thinking it's
> > > another domain or if it's a similar problem, though.  
> > > 
> > > Thanks,
> > > Stephen
> > > 
> > > 
> > > 
> > > 
> > > ----- Original message -----
> > > From: "Stephen Charles Huey" <stephenhuey@fastmail.fm>
> > > To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
> > > Date: Wed, 07 Apr 2004 10:12:02 -0500
> > > Subject: Re: HttpClient:  Maximum redirects (100) exceeded
> > > 
> > > I didn't copy all of my message here.  Basically, my problem is that I'm
> > > getting this when trying to execute a simple GET:
> > > 
> > > Apr 7, 2004 10:00:54 AM org.apache.commons.httpclient.HttpMethodBase
> > > execute
> > > 
> > > SEVERE: Narrowly avoided an infinite loop in execute
> > > 
> > > org.apache.commons.httpclient.HttpRecoverableException: Maximum redirects
> > > (100) exceeded
> > > 
> > > 	at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1111)
> > > 
> > > 
> > > I've been doing this for a long time, but something changed on the
> > > website and I guess that change is making me go into an infinite loop, so
> > > I'm trying to figure out how to get around that so I can download my
> > > addresses with this Java program once again.  The statement "Execute loop
> > > try 1" will show up 100 times in my wire trace log, and it just tries the
> > > same block of code below each time.  I don't understand a lot of it, but
> > > I'm particularly wondering what it means when it says "Should close
> > > connection in response to Connection: close".  I'm also wondering why the
> > > socket appears to be stale...I had to use a GET and a POST and a GET
> > > before this point, so there has been plenty of activity!  
> > > 
> > > 
> > > 
> > > 2004/04/07 09:38:56:211 CDT [DEBUG] HttpConnection -
> > > -HttpConnection.setSoTimeout(0)
> > > 
> > > 2004/04/07 09:38:56:361 CDT [DEBUG] HttpConnection - -An error occurred
> > > while reading from the socket, is appears to be stale
> > > <java.net.SocketException: Socket Closed>java.net.SocketException: Socket
> > > Closed
> > > 
> > > 	at java.net.PlainSocketImpl.setOption(Unknown Source)
> > > 
> > > 	at java.net.Socket.setSoTimeout(Unknown Source)
> > > 
> > > 	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.setSoTimeout(Unknown Source)
> > > 
> > > 	at org.apache.commons.httpclient.HttpConnection.isStale(HttpConnection.java:542)
> > > 
> > > 	at org.apache.commons.httpclient.HttpConnection.isOpen(HttpConnection.java:468)
> > > 
> > > 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:660)
> > > 
> > > 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
> > > 
> > > 	at FedexWebImporter.importAll(FedexWebImporter.java:82)
> > > 
> > > 	at FedexWebImporter.main(FedexWebImporter.java:156)
> > > 
> > > 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > 
> > > 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > > 
> > > 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > > 
> > > 	at java.lang.reflect.Method.invoke(Unknown Source)
> > > 
> > > 	at koala.dynamicjava.interpreter.EvaluationVisitor.visit(EvaluationVisitor.java:666)
> > > 
> > > 	at edu.rice.cs.drjava.model.repl.EvaluationVisitorExtension.visit(EvaluationVisitorExtension.java:254)
> > > 
> > > 	at koala.dynamicjava.tree.StaticMethodCall.acceptVisitor(StaticMethodCall.java:107)
> > > 
> > > 	at edu.rice.cs.drjava.model.repl.DynamicJavaAdapter$InterpreterExtension.interpret(DynamicJavaAdapter.java:493)
> > > 
> > > 	at edu.rice.cs.drjava.model.repl.DynamicJavaAdapter.interpret(DynamicJavaAdapter.java:96)
> > > 
> > > 	at edu.rice.cs.drjava.model.repl.newjvm.InterpreterJVM$4.run(InterpreterJVM.java:264)
> > > 
> > > 
> > > 
> > > 2004/04/07 09:38:56:532 CDT [DEBUG] HttpConnection - -Connection is
> > > stale, closing...
> > > 
> > > 2004/04/07 09:38:56:732 CDT [DEBUG] HttpMethodBase - -Execute loop try 1
> > > 
> > > 2004/04/07 09:38:56:852 CDT [DEBUG] wire - ->> "GET
> > > /swab/AddressMain.do?appID=FSM&cc_lang=us&cc=us&language=us&sType=&gnd_flag=Y&dgalc=N
> > > HTTP/1.1[\r][\n]"
> > > 
> > > 2004/04/07 09:38:56:952 CDT [DEBUG] HttpMethodBase - -Adding Host request
> > > header
> > > 
> > > 2004/04/07 09:38:57:062 CDT [DEBUG] wire - ->> "User-Agent: Jakarta
> > > Commons-HttpClient/2.0final[\r][\n]"
> > > 
> > > 2004/04/07 09:38:57:203 CDT [DEBUG] wire - ->> "Host:
> > > www.fedex.com[\r][\n]"
> > > 
> > > 2004/04/07 09:38:57:343 CDT [DEBUG] wire - ->> "Cookie: $Version=0;
> > > fdx_login=41.bb83.4d658350; $Domain=.fedex.com; $Path=/[\r][\n]"
> > > 
> > > 2004/04/07 09:38:57:493 CDT [DEBUG] wire - ->> "Cookie: $Version=0;
> > > fdx_appname=inet; $Domain=.fedex.com; $Path=/[\r][\n]"
> > > 
> > > 2004/04/07 09:38:57:693 CDT [DEBUG] wire - ->> "[\r][\n]"
> > > 
> > > 2004/04/07 09:38:57:813 CDT [DEBUG] wire - -<< "HTTP/1.1 302 Moved
> > > Temporarily[\r][\n]"
> > > 
> > > 2004/04/07 09:38:57:944 CDT [DEBUG] wire - -<< "Server:
> > > Netscape-Enterprise/4.1[\r][\n]"
> > > 
> > > 2004/04/07 09:38:58:084 CDT [DEBUG] wire - -<< "Date: Wed, 07 Apr 2004
> > > 14:38:52 GMT[\r][\n]"
> > > 
> > > 2004/04/07 09:38:58:234 CDT [DEBUG] wire - -<< "Location:
> > > https://www.fedex.com/cgi-bin/ssoswab;SWABSESSIONID=A0S85B1LbPcoaGqyWhaC7m4x6gxJ3ptWQa2gGiFlp1I1DoPWJA0W!1270069690!wwls9.sac.fedex.com!7998!7002?cc_lang=us_en&returnurl=https://www.fedex.com/swab/AddressMain.do?appID%3DFSM%26cc_lang%3Dus%26cc%3Dus%26language%3Dus%26sType%3D%26gnd_flag%3DY%26dgalc%3DN[\r][\n]"
> > > 
> > > 2004/04/07 09:38:58:384 CDT [DEBUG] wire - -<< "Content-Type:
> > > text/html[\r][\n]"
> > > 
> > > 2004/04/07 09:38:58:525 CDT [DEBUG] wire - -<< "Set-Cookie:
> > > SWABSESSIONID=A0S85B1LbPcoaGqyWhaC7m4x6gxJ3ptWQa2gGiFlp1I1DoPWJA0W!1270069690!wwls9.sac.fedex.com!7998!7002;
> > > path=/[\r][\n]"
> > > 
> > > 2004/04/07 09:38:58:695 CDT [DEBUG] wire - -<< "Connection:
> > > close[\r][\n]"
> > > 
> > > 2004/04/07 09:38:58:845 CDT [DEBUG] HttpMethodBase - -Cookie accepted:
> > > "$Version=0;
> > > SWABSESSIONID=A0S85B1LbPcoaGqyWhaC7m4x6gxJ3ptWQa2gGiFlp1I1DoPWJA0W!1270069690!wwls9.sac.fedex.com!7998!7002;
> > > $Path=/"
> > > 
> > > 2004/04/07 09:38:58:995 CDT [DEBUG] HttpMethodBase - -Redirect required
> > > 
> > > 2004/04/07 09:38:59:205 CDT [DEBUG] HttpMethodBase - -Redirect requested
> > > to location
> > > 'https://www.fedex.com/cgi-bin/ssoswab;SWABSESSIONID=A0S85B1LbPcoaGqyWhaC7m4x6gxJ3ptWQa2gGiFlp1I1DoPWJA0W!1270069690!wwls9.sac.fedex.com!7998!7002?cc_lang=us_en&returnurl=https://www.fedex.com/swab/AddressMain.do?appID%3DFSM%26cc_lang%3Dus%26cc%3Dus%26language%3Dus%26sType%3D%26gnd_flag%3DY%26dgalc%3DN'
> > > 
> > > 2004/04/07 09:38:59:306 CDT [DEBUG] HttpMethodBase - -Redirecting from
> > > 'https://www.fedex.com:443/swab/AddressMain.do' to
> > > 'https://www.fedex.com/cgi-bin/ssoswab;SWABSESSIONID=A0S85B1LbPcoaGqyWhaC7m4x6gxJ3ptWQa2gGiFlp1I1DoPWJA0W!1270069690!wwls9.sac.fedex.com!7998!7002?cc_lang=us_en&returnurl=https://www.fedex.com/swab/AddressMain.do?appID%3DFSM%26cc_lang%3Dus%26cc%3Dus%26language%3Dus%26sType%3D%26gnd_flag%3DY%26dgalc%3DN
> > > 
> > > 2004/04/07 09:38:59:446 CDT [DEBUG] HttpMethodBase - -Should close
> > > connection in response to Connection: close
> > > 
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > > 
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message