hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: HttpClient 2.0 rc3: java.io.StreamCorruptedException
Date Thu, 22 Jan 2004 15:09:01 GMT
Hi Joel,

Please take a look at the SSL guide for an example of how to use an SSL  
proxy <http://jakarta.apache.org/commons/httpclient/sslguide.html>.   
Generally speaking you do not want to manually create and use the  
ConnectMethod.  This is handled by HttpClient.execute().

Mike

On Jan 22, 2004, at 8:45 AM, Jean-Noel Heyraud wrote:
>
> Hi All,
>
> I 've tried to port my application from java.io.* to httpClient.  
> Everything
> works fine (http, https), except when my client need to communication  
> via a
> proxy (no need to set user or password) using SSL.
>
> any idea?
>
> PostMethod postMethod = new PostMethod(URI);
>
> file = new File(fileName);
> postMethod.setRequestBody(new FileInputStream(file));
> postMethod.setRequestContentLength((int)file.length());
>
> if (connection.isProxied() && connection.isSecure()) {
>       postMethod = new ConnectMethod(postMethod);
> }
>
> postMethod.execute(httpState,connection);
> if (postMethod.getStatusCode() == HttpStatus.SC_OK) {
>       ObjectInputStream fromETravel = new
> ObjectInputStream(postMethod.getResponseBodyAsStream());
>
>
> <Thu Jan 22, 2004 14:26:49 CET> [JCO.ServerThread-1] ERROR  
> com.amadeus.sap
> - [ETravelBridgeClient] InputStream does not contain a serialized  
> object
> java.io.StreamCorruptedException: InputStream does not contain a  
> serialized
> object
>       at
> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:844)
>       at java.io.ObjectInputStream.<init>(ObjectInputStream.java:163)
>       at
> com.amadeus.sap.client.rfc.AbstractETravelBridgeClient$ConnectionListen 
> er.sendRFC4Process(AbstractETravelBridgeClient.java:398)
>       at
> com.amadeus.sap.client.rfc.AbstractETravelBridgeClient$ConnectionListen 
> er.handleRequest(AbstractETravelBridgeClient.java:347)
>       at com.sap.mw.jco.JCO$Server.dispatchRequest(Unknown Source)
>       at com.sap.mw.jco.rfc.MiddlewareRFC$Server.nativeListen(Native
> Method)
>       at com.sap.mw.jco.rfc.MiddlewareRFC$Server.listen(Unknown Source)
>       at com.sap.mw.jco.JCO$Server.listen(Unknown Source)
>       at com.sap.mw.jco.JCO$Server.run(Unknown Source)
>       at java.lang.Thread.run(Thread.java:479)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:  
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:  
> commons-httpclient-dev-help@jakarta.apache.org
>


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


Mime
View raw message