Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2585

Already connected exception when using a proxy created with JAXRSClientFactory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.5
    • 2.2.6, 2.3
    • JAX-RS
    • None
    • JDK 1.5.0.18

    • Novice

    Description

      I'm trying to get a very simple Rest client working, but I always got this exception:

      java.lang.IllegalStateException: Already connected
      at java.net.HttpURLConnection.setFixedLengthStreamingMode(HttpURLConnection.java:100)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.thresholdNotReached(HTTPConduit.java:1885)
      at org.apache.cxf.io.AbstractThresholdOutputStream.close(AbstractThresholdOutputStream.java:99)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1976)
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:637)
      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
      at org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:429)
      at org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:166)
      at $Proxy16.doSomething(Unknown Source)
      at 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 = JAXRSClientFactory.create("http://localhost:8080/RestWSMock",RestWS.class);
      proxy.doSomething("bob");

      I can not get it simpler. Any idea what's wrong ?
      regards

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            sallegro StéphaneA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: