commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: [HTTPClient] Getting Protocol Exception
Date Fri, 09 Dec 2005 22:16:08 GMT
On Fri, 2005-12-09 at 11:41 -0500, Bryce Fischer wrote:

> Here is the wire trace:
> 
> DEBUG [httpclient.wire.header] >> "POST / HTTP/1.1[\r][\n]"
> DEBUG [httpclient.wire.header] >> "User-Agent: Jakarta
> Commons-HttpClient/3.0-rc4[\r][\n]"
> DEBUG [httpclient.wire.header] >> "Host: xxx.xxx.xxx.xxx:81[\r][\n]"
> DEBUG [httpclient.wire.header] >> "Content-Length: 4462[\r][\n]"
> DEBUG [httpclient.wire.header] >> "Content-Type:
> application/x-www-form-urlencoded[\r][\n]"
> DEBUG [httpclient.wire.header] >> "[\r][\n]"
> DEBUG [httpclient.wire.content] >> "xml=<content removed>"
> DEBUG [httpclient.wire.header] << "<xml data removed>"
> DEBUG [httpclient.wire.header] << "  <more data removed>[\r][\n]"
> DEBUG [httpclient.wire.header] << "  <more data removed[\r][\n]"
> DEBUG [httpclient.wire.header] << "<more data removed[\r][\n]"
> DEBUG [httpclient.wire.header] << "<data removed>[\r][\n]"
> DEBUG [httpclient.wire.header] << "null[\r][\n]"
> 
Bryce,

What server is sending back is not a valid HTTP response. HttpClient is
absolutely correct in throwing a protocol exception

Oleg




> First thing I noticed was that the data was being returned with the
> header. That is why I was trying to set the parameters in the code
> above (it didn't work without the parameters either).
> 
> Any help would be appreciated.
> 
> Thanks
> Bryce
> 
> Entire Stack Trace:
> org.apache.commons.httpclient.ProtocolException: The server
> xxx.xxx.xxx.xxx failed to respond with a valid HTTP response
> 	at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1846)
> 	at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
> 	at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
> 	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:395)
> 	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> 	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
> 	at com.company.Test.testMakeRequest2(Test.java:81)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
> 
> ---------------------------------------------------------------------
> 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