Return-Path: X-Original-To: apmail-hc-httpclient-users-archive@www.apache.org Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0E3A39740 for ; Tue, 7 Aug 2012 20:53:06 +0000 (UTC) Received: (qmail 1339 invoked by uid 500); 7 Aug 2012 20:53:05 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 1301 invoked by uid 500); 7 Aug 2012 20:53:05 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 1292 invoked by uid 99); 7 Aug 2012 20:53:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2012 20:53:05 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [217.150.250.48] (HELO kalnich.nine.ch) (217.150.250.48) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2012 20:52:57 +0000 Received: from [192.168.1.147] (77-57-197-206.dclient.hispeed.ch [77.57.197.206]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by kalnich.nine.ch (Postfix) with ESMTPSA id 9B964B800F9; Tue, 7 Aug 2012 22:52:36 +0200 (CEST) Message-ID: <1344372755.2021.6.camel@ubuntu> Subject: Re: Strange ClassCastException From: Oleg Kalnichevski To: HttpClient User Discussion Cc: Harold Rosenberg Date: Tue, 07 Aug 2012 22:52:35 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org On Tue, 2012-08-07 at 10:52 -0700, Harold Rosenberg wrote: > I am using the AsyncClient (4.0-beta1) as part of an HTTP workload driver= , along with HttpCore 4.2.1 and HttpClient 4.2.1. My primary entry-point i= s through calls to execute(HttpUriRequest request,HttpContex= t context, FutureCallback> callback) on a DefaultHttpAsyncClient. I am sporadically getting the = following exception: >=20 > 12/08/06 08:31:21 ERROR protocol.HttpAsyncRequestExecutor: http-outgoing-= 143466 [ACTIVE] HTTP protocol exception: org.apache.http.impl.nio.conn.Defa= ultClientAsyncConnection cannot be cast to org.apache.http.conn.HttpRoutedC= onnection > java.lang.ClassCastException: org.apache.http.impl.nio.conn.DefaultClient= AsyncConnection cannot be cast to org.apache.http.conn.HttpRoutedConnection > at org.apache.http.client.protocol.RequestAddCookies.process(RequestAddCo= okies.java:123) > at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpP= rocessor.java:109) > at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.requestReady(Htt= pAsyncRequestExecutor.java:157) > at org.apache.http.impl.nio.client.LoggingAsyncRequestExecutor.requestRea= dy(LoggingAsyncRequestExecutor.java:89) > at org.apache.http.impl.nio.DefaultNHttpClientConnection.produceOutput(De= faultNHttpClientConnection.java:225) > at org.apache.http.impl.nio.DefaultHttpClientIODispatch.onOutputReady(Def= aultHttpClientIODispatch.java:130) > at org.apache.http.impl.nio.DefaultHttpClientIODispatch.onOutputReady(Def= aultHttpClientIODispatch.java:50) > at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(Abstra= ctIODispatch.java:141) > at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.= java:181) > at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(Abstra= ctIOReactor.java:346) > at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(Abstr= actIOReactor.java:320) > at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOR= eactor.java:280) > at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.j= ava:106) > at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.r= un(AbstractMultiworkerIOReactor.java:601) > at java.lang.Thread.run(Thread.java:662) >=20 > This shows up in my code as a call to failed(Exception) in my FutureCallb= ack. >=20 > This only occurs very rarely (e.g. 7 such exceptions during a run with 1.= 4 million calls to execute), and I can handle the exception and retry the o= peration, but I find it very puzzling. Using a debugger, I have looked at = the state of the application on both successful and unsuccessful calls thro= ugh this code path, and I can't see any difference. >=20 > Does anyone have any ideas about what might be causing this? I have trie= d with both JDK 1.6.0_33 and 1.7.0_5 and get the same exception on both. >=20 > Thanks, >=20 > Hal >=20 Hi Hal This looks like a bug in HttpAsyncClient. Please raise a JIRA for this defect. It is a shame this report did not come a little earlier. We just released 4.0-beta2. Oleg=20 --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org