http:client configuration with Spring PropertyPlaceholderConfigurer -------------------------------------------------------------------
Key: CXF-2113 URL: https://issues.apache.org/jira/browse/CXF-2113 Project: CXF Issue Type: Improvement Components: Configuration Affects Versions: 2.1.4 Environment: any Reporter: Sven Reinahrdt Priority: Minor -Problem: changing configuration of proxy in conduit client with spring PropertyPlaceholderConfigurer -Backgound: to avoid rebuild of the application for differnt environments configurations are externalized in property files like this: <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations" value="classpath:ws_client.properties" /> </bean> <http:conduit ... > <http:client ProxyServer="${ws.client.ProxyServer}" ProxyServerPort="${ws.client.ProxyServer}" /> </http:conduit> ws_client.properties: ws.client.ProxyServer=proxy ws.client.ProxyServerPort=8080 But this fails for two reasons: 1. org.apache.cxf.transports.http.configuration.HTTPClientPolicy getProxyServerPort() is an integer ProxyServerPort="${ws.client.ProxyServer}" fails because the xml is validated in advance of the placeholder replacement (this might be a spring issue or else) it could work if there would be a setProxyServerPortStr(String port) mehode 2. if there is no proxy it cant be "undone" because org.apache.cxf.transport.http.HTTPConduit getProxy(HTTPClientPolicy) only cheks ProxyServer via HTTPClientPolicy.isSetProxyServer for null if properties are set to: ws.client.ProxyServer= ws.client.ProxyServerPort=0 it results in a connection refused, because the empty String proxy does not exist if properties are commented out spring complains about it - Proposed solution: add methode setProxyServerPortStr(String port) HTTPClientPolicy.isSetProxyServer also checks is proxyServer.length>0 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.