You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2009/06/30 17:39:47 UTC

[jira] Resolved: (CXF-2113) http:client configuration with Spring PropertyPlaceholderConfigurer

     [ https://issues.apache.org/jira/browse/CXF-2113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-2113.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.3
                   2.1.6
                   2.0.12
         Assignee: Daniel Kulp


I'm going to "resolve" this, although it's only 1/2 resolved.

I've fixed the issue of not being able to "unconfigure" the proxy server by checking if the server string is empty.   That should fix that issue.

The schema validation issue of "int" with property placeholders is a Spring thing that they SAY they may have fixed in 3.x.   For 2.x, you would need to turn off the spring schema validation.



> 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 Reinhardt
>            Assignee: Daniel Kulp
>            Priority: Minor
>             Fix For: 2.0.12, 2.1.6, 2.2.3
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> -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.