hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: HttpClient
Date Wed, 19 Aug 2009 11:30:42 GMT
On 19/08/2009, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Wed, Aug 19, 2009 at 01:05:51PM +0300, Al Jesco wrote:
>  > 2009/8/19 Oleg Kalnichevski <olegk@apache.org>:
>  > > On Wed, Aug 19, 2009 at 01:00:23PM +0300, Al Jesco wrote:
>  > >> 2009/8/19 Oleg Kalnichevski <olegk@apache.org>:
>  > >> > On Tue, Aug 18, 2009 at 09:01:38PM +0300, aljesco wrote:
>  > >> >> Hello all!
>  > >> >> I'm using HttpClient 4.0 and got some error.
>  > >> >> There's code I tested
>  > >> >>
>  > >> >> *****
>  > >> >> ? ? ?DefaultHttpClient httpclient = new DefaultHttpClient();
>  > >> >> ? ? ?HttpGet httpget = new HttpGet("http://yandex.ru");
>  > >> >> ? ? ?HttpResponse response = httpclient.execute(httpget);
>  > >> >> ? ? ?HttpEntity entity = response.getEntity();
>  > >> >> ? ? ?System.out.println("Login form get: " + response.getStatusLine());
>  > >> >> ? ? ?if (entity != null) {
>  > >> >> ? ? ? ? ?entity.consumeContent();
>  > >> >> ? ? ?}
>  > >> >> ? ? ?System.out.println("Initial set of cookies:");
>  > >> >> ? ? ?List<Cookie> cookies = httpclient.getCookieStore().
>  > >> >> getCookies();
>  > >> >> ? ? ?if (cookies.isEmpty()) {
>  > >> >> ? ? ? ? ?System.out.println("None");
>  > >> >> ? ? ?} else {
>  > >> >> ? ? ? ? ?for (int i = 0; i < cookies.size(); i++) {
>  > >> >> ? ? ? ? ? ? ?System.out.println("- " + cookies.get(i).toString());
>  > >> >> ? ? ? ? ?}
>  > >> >> ? ? ?}
>  > >> >> ? ? ?httpclient.getConnectionManager().shutdown();
>  > >> >> *****
>  > >> >>
>  > >> >> It's working fine in Netbeans 6.5.1 (using java 1.6.0_14) and
>  > >> >> httpclient.execute(httpget) works successfully.
>  > >> >> In Eclipse 3.4.2 (using java 1.6.0_16) this error is occurried.
>  > >> >>
>  > >> >>
>  > >> >
>  > >> > 'Software caused connection abort: socket write error' usually means
the
>  > >> > connection has been terminated abnormally either by the target server,
or by an
>  > >> > intermediate proxy or due to some other kind of connectivity issue.
>  > >> >
>  > >> > This problem has nothing to do with Httpclient and is likely to be
a problem
>  > >> > with your local setup.
>  > >> >
>  > >> > Oleg
>  > >> >
>  > >> >
>  > >> >
>  > >> >> *****
>  > >> >> 18.08.2009 0:21:54 org.apache.http.impl.client.DefaultRequestDirector
>  > >> >> execute
>  > >> >> INFO: I/O exception (java.net.SocketException) caught when processing
>  > >> >> request: Software caused connection abort: socket write error
>  > >> >> 18.08.2009 0:21:54 org.apache.http.impl.client.DefaultRequestDirector
>  > >> >> execute
>  > >> >> INFO: Retrying request
>  > >> >> 18.08.2009 0:21:54 org.apache.http.impl.client.DefaultRequestDirector
>  > >> >> execute
>  > >> >> INFO: I/O exception (java.net.SocketException) caught when processing
>  > >> >> request: Software caused connection abort: socket write error
>  > >> >> 18.08.2009 0:21:54 org.apache.http.impl.client.DefaultRequestDirector
>  > >> >> execute
>  > >> >> INFO: Retrying request
>  > >> >> 18.08.2009 0:21:54 org.apache.http.impl.client.DefaultRequestDirector
>  > >> >> execute
>  > >> >> INFO: I/O exception (java.net.SocketException) caught when processing
>  > >> >> request: Software caused connection abort: socket write error
>  > >> >> 18.08.2009 0:21:54 org.apache.http.impl.client.DefaultRequestDirector
>  > >> >> execute
>  > >> >> INFO: Retrying request
>  > >> >> Exception in thread "main" java.net.SocketException: Software
caused
>  > >> >> connection abort: socket write error
>  > >> >> ?at java.net.SocketOutputStream.socketWrite0(Native Method)
>  > >> >> ?at java.net.SocketOutputStream.socketWrite(Unknown Source)
>  > >> >> ?at java.net.SocketOutputStream.write(Unknown Source)
>  > >> >> ?at
>  > >> >> org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:106)
>  > >> >>
>  > >> >>
>  > >> >> ?at
>  > >> >> org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSessionOutputBuffer.java:113)
>  > >> >>
>  > >> >>
>  > >> >> ?at
>  > >> >> org.apache.http.impl.AbstractHttpClientConnection.doFlush(AbstractHttpClientConnection.java:260)
>  > >> >>
>  > >> >>
>  > >> >> ?at
>  > >> >> org.apache.http.impl.SocketHttpClientConnection.close(SocketHttpClientConnection.java:248)
>  > >> >>
>  > >> >>
>  > >> >> ?at
>  > >> >> org.apache.http.impl.conn.DefaultClientConnection.close(DefaultClientConnection.java:154)
>  > >> >>
>  > >> >>
>  > >> >> ?at
>  > >> >> org.apache.http.impl.conn.AbstractPooledConnAdapter.close(AbstractPooledConnAdapter.java:131)
>  > >> >>
>  > >> >>
>  > >> >> ?at
>  > >> >> org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:130)
>  > >> >>
>  > >> >>
>  > >> >> ?at
>  > >> >> org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:447)
>  > >> >>
>  > >> >>
>  > >> >> ?at
>  > >> >> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)
>  > >> >>
>  > >> >>
>  > >> >> ?at
>  > >> >> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576)
>  > >> >>
>  > >> >>
>  > >> >> ?at
>  > >> >> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:554)
>  > >> >>
>  > >> >>
>  > >> >> ?at Main.main(Main.java:52)
>  > >> >> *****
>  > >> >>
>  > >> >> This error also occurring when I'm trying to launch program using
>  > >> >> system JRE (windows xp sp2, JRE 1.6.0_16).
>  > >> >>
>  > >> >> Can anyone help me..?
>  > >> >>
>  > >> >>
>  > >> >> ---------------------------------------------------------------------
>  > >> >> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  > >> >> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>  > >> >>
>  > >> >
>  > >> > ---------------------------------------------------------------------
>  > >> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  > >> > For additional commands, e-mail: httpclient-users-help@hc.apache.org
>  > >> >
>  > >> >
>  > >>
>  > >> Thanks for reply, Oleg.
>  > >> So.. Why is it working fine in netbeans..?
>  > >>
>  > >
>  > > Because Eclipse and Netbeans are two completely different things. Check your
>  > > local setup.
>  > >
>  > > Oleg
>  > >
>  > >
>  > >> ---------------------------------------------------------------------
>  > >> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  > >> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>  > >>
>  > >
>  > > ---------------------------------------------------------------------
>  > > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  > > For additional commands, e-mail: httpclient-users-help@hc.apache.org
>  > >
>  > >
>  >
>  > What do you mean for "local setup"?
>  >
>
>
> Eclipse configuration, such as proxy settings, TCP/IP settings, firewall settings, if
you are using one, anything that has to do with connectivity.
>
>  You may also want to try running your app as a standalone process in order to see if
the problem is related to your Eclipse setup.
>

I've just noticed that you are using two different versions of Java
1.6 - 1.6.0_14 and 1.6.0_16 - which suggests that you are using two
different hosts.

If so, then different host setup or network connectivity is the most
likely cause.

>  Oleg
>
>
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  > For additional commands, e-mail: httpclient-users-help@hc.apache.org
>  >
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>  For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message