Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 74941 invoked from network); 17 Dec 2009 13:33:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Dec 2009 13:33:41 -0000 Received: (qmail 98929 invoked by uid 500); 17 Dec 2009 13:33:41 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 98902 invoked by uid 500); 17 Dec 2009 13:33:41 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 98892 invoked by uid 99); 17 Dec 2009 13:33:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Dec 2009 13:33:41 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Dec 2009 13:33:38 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 32EBC29A001D for ; Thu, 17 Dec 2009 05:33:18 -0800 (PST) Message-ID: <1695616844.1261056798207.JavaMail.jira@brutus> Date: Thu, 17 Dec 2009 13:33:18 +0000 (UTC) From: "S.Allegro (JIRA)" To: issues@cxf.apache.org Subject: [jira] Issue Comment Edited: (CXF-2585) Already connected exception when using a proxy created with JAXRSClientFactory In-Reply-To: <338802699.1260983298063.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-2585?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D127919= 19#action_12791919 ]=20 S.Allegro edited comment on CXF-2585 at 12/17/09 1:32 PM: ---------------------------------------------------------- Thank's for your quick answer I prefer the 2nd workaround, and I will enjoy some code for the interceptor= . (PS: in fact, I setup my proxy using Spring, not JAXRSClientFactory directl= y) was (Author: sallegro): Thank's for your quick answer I prefer the 2nd workaround, and I will enjoy some code for the interceptor= . (PS: in fact, I setup my proxy using Spring, not JAXRSClientFactory directl= y) St=C3=A9phane -----Message d'origine----- De : Sergey Beryozkin (JIRA) [mailto:jira@apache.org]=20 Envoy=C3=A9 : mercredi 16 d=C3=A9cembre 2009 21:50 =C3=80 : ALLEGRO Stephane RD-BIZZ-ISS Objet : [jira] Commented: (CXF-2585) Already connected exception when using= a proxy created with JAXRSClientFactory [ https://issues.apache.org/jira/browse/CXF-2585?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D127915= 76#action_12791576 ]=20 Sergey Beryozkin commented on CXF-2585: --------------------------------------- it is a bug affecting a proxy based flavor only.=20 The problem is that a proxy does not indicate to the transport-level HttpCo= nduit that an empty POST (with no request body) is coming which is somethin= g that never occurs with SOAP proxies. It will be fixed for soon to be released 2.2.6 Couple of workarounds. 1. Use WebClient : Response r =3D WebClient.create(endpointAddress).query("param", "bob").post= (null); String s =3D (String)r.getEntity(); 2. If you do prefer to use a proxy then for the empty POST be processed cor= rectly, you can temporarily register a CXF out interceptor with a proxy and= set a "org.apache.cxf.post.empty" property on a message - let me know plea= se if you'd like to try this option and I will post a code for the intercep= tor thanks -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. =20 > Already connected exception when using a proxy created with JAXRSClientFa= ctory > -------------------------------------------------------------------------= ----- > > Key: CXF-2585 > URL: https://issues.apache.org/jira/browse/CXF-2585 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.2.5 > Environment: JDK 1.5.0.18 > Reporter: S.Allegro > Assignee: Sergey Beryozkin > Fix For: 2.2.6, 2.3 > > > I'm trying to get a very simple Rest client working, but I always got thi= s exception: > java.lang.IllegalStateException: Already connected > =09at java.net.HttpURLConnection.setFixedLengthStreamingMode(HttpURLConne= ction.java:100) > =09at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.thres= holdNotReached(HTTPConduit.java:1885) > =09at org.apache.cxf.io.AbstractThresholdOutputStream.close(AbstractThres= holdOutputStream.java:99) > =09at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close= (HTTPConduit.java:1976) > =09at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java= :66) > =09at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:63= 7) > =09at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEn= dingInterceptor.handleMessage(MessageSenderInterceptor.java:62) > =09at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterce= ptorChain.java:236) > =09at org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(Cli= entProxyImpl.java:429) > =09at org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.= java:166) > =09at $Proxy16.doSomething(Unknown Source) > =09at com.francetelecom.resttest.RestTest.main(RestTest.java:27) > Here is my jax-rs interface: > @Path("/") > public interface RestWS { > @POST > @Path("/test") > public String doSomething( @QueryParam("param") String paramName); > } > And here the way my client uses it: > RestWS proxy =3D JAXRSClientFactory.create("http://localhost:8080/RestWSM= ock",RestWS.class); > proxy.doSomething("bob"); > I can not get it simpler. Any idea what's wrong ? > regards --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.