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

Setting use.async.http.conduit property causes IllegalArgumentException

    XMLWordPrintableJSON

    Details

    • Estimated Complexity:
      Unknown

      Description

      After upgrading from CXF 3.0.0 to 3.0.1 we are experiencing an IllegalArgumentException in every request from a generated client code to the target WS, probably related to following cxf.xml fragment:

      [...]
      	<cxf:bus>
      		[...]
      		<cxf:properties>
      			<!-- Apache AsyncHttpClient properties (http://cxf.apache.org/docs/asynchronous-client-http-transport.html) -->
      		
      			<!-- Always use Apache AsyncHttpClient for HTTP transport -->
      			<entry key="use.async.http.conduit" value="true"/>
      		</cxf:properties>
      
      	</cxf:bus>
      [...]
      

      Exception:

      java.lang.IllegalArgumentException: No enum const class org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduitFactory$UseAsyncPolicy.TRUE
              at java.lang.Enum.valueOf(Enum.java:196)
              at org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduitFactory$UseAsyncPolicy.valueOf(AsyncHTTPConduitFactory.java:90)
              at org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduit.setupConnection(AsyncHTTPConduit.java:153)
              at org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:483)
              at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
              at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
              at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
              at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)
              at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
              at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
              at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137)
              ... 12 common frames omitted
      

      The value 'true' for 'use.async.http.conduit' property seems to be converted to uppercase, then passed directly to 'valueOf' method of Enum.

      According to online documentation, such configuration should result in using AsyncHTTPConduitFactory$UseAsyncPolicy.ALWAYS by CXF.

      It works as expected in 3.0.0, having the effect of using async http client for every request.

      It seems that using the following configuration is a valid workaround:

      [...]
      	<cxf:bus>
      		[...]
      		<cxf:properties>
      			<!-- Apache AsyncHttpClient properties (http://cxf.apache.org/docs/asynchronous-client-http-transport.html) -->
      		
      			<!-- Always use Apache AsyncHttpClient for HTTP transport -->	
                  <entry key="org.apache.cxf.transport.http.async.usePolicy" value="ALWAYS" />
      		</cxf:properties>
      
      	</cxf:bus>
      [...]
      

      The online documentation states that the above configuration is similar (not identical) to using 'use.async.http.conduit' property. What are the differences (if any)? Is it a valid workaround?

      Best Regards,
      Przemysław Ołtarzewski

        Attachments

          Activity

            People

            • Assignee:
              dkulp Daniel Kulp
              Reporter:
              poltarzewski Przemysław Ołtarzewski
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: