Przemysław Ołtarzewski created CXF-5968:
-------------------------------------------

             Summary: Setting use.async.http.conduit property causes 
IllegalArgumentException
                 Key: CXF-5968
                 URL: https://issues.apache.org/jira/browse/CXF-5968
             Project: CXF
          Issue Type: Bug
          Components: Configuration, Transports
    Affects Versions: 3.0.1
         Environment: SunOS 5.10
            Reporter: Przemysław Ołtarzewski


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:

{noformat}
[...]
        <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>
[...]
{noformat}

Exception:

{noformat}
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
{noformat}

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:

{noformat}
[...]
        <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>
[...]
{noformat}

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



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to