I don't think in 2.1.3 you can. I think it was fixed in 2.1.6.
Dan
On Wed October 28 2009 12:48:33 pm shand wrote:
> Is it possible to use property placeholders to substitute values for a
> keyStore's location and password? I'm using CXF 2.1.3 and Spring 2.0.5.
>
> I have an HTTP conduit configuration like the following, but I want to make
> the file and password attributes on the <keyStore> configurable using
> property placeholders:
>
> <http-conf:conduit name="*.http-conduit">
> <http-conf:tlsClientParameters secureSocketProtocol="SSL">
> <sec:trustManagers>
> <sec:keyStore type="JKS" password="changeit"
> file="C:\Program
> Files\Java\jdk1.5.0_17\\jre\lib\security\cacerts"/>
> </sec:trustManagers>
> </http-conf:tlsClientParameters>
> <http-conf:client ConnectionTimeout="10000" ReceiveTimeout="5000"
> Connection="Keep-Alive" AutoRedirect="true" AllowChunking="false"
> /> </http-conf:conduit>
>
> When I replace it with the following, I get FileNotFoundExceptions for
> "$Env{java.home}\jre\lib\security\cacerts", treating the value as a literal
> without performing the placeholder substitution. I know the file exists,
> because the original configuration works fine.
>
> <bean id="envPropertyConfigurer"
>
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigur
> er"> <property name="locations">
> <list>
> <value>classpath:/properties/Env.properties</value>
> </list>
> </property>
> <property name="placeholderPrefix" value="$Env{" />
> </bean>
>
> <http-conf:conduit name="*.http-conduit">
> <http-conf:tlsClientParameters secureSocketProtocol="SSL">
> <sec:trustManagers>
> <sec:keyStore type="JKS" password="$Env{keystore.password}"
> file="$Env{java.home}\jre\lib\security\cacerts"/>
> </sec:trustManagers>
> </http-conf:tlsClientParameters>
> <http-conf:client ConnectionTimeout="10000" ReceiveTimeout="5000"
> Connection="Keep-Alive"
> AutoRedirect="true" AllowChunking="false" />
> </http-conf:conduit>
>
> Here's my Env.properties file:
> java.home=C:\Program Files\Java\jdk1.5.0_17
> keystore.password=changeit
>
> I've seen several posts on the forum about issues with integer-valued
> placeholders, which I've also experienced in other parts of the
> configuration, but it seems to me that the placeholder substitution
> mechanism just isn't supported here.
>
> Can anyone confirm this or tell me what I'm doing wrong? Is there any
> other way to achieve what I want?
>
> Thanks so much for your help.
>
> Sarah
>
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog