2013-11-03 36 views
3

现在有最奇怪的问题 - 有一个Spring XML文件,其中jaxws:client的地址属性使用地址属性的属性占位符,但它拒绝解析地址属性。jaxws:客户端地址属性不解决占位符

这是日志文件错误:

 
    Caused by: java.net.MalformedURLException: no protocol: ${member.service.uri} 
    at java.net.URL.(URL.java:567) ~[na:1.6.0_33] 
    at java.net.URL.(URL.java:464) ~[na:1.6.0_33] 
    at java.net.URL.(URL.java:413) ~[na:1.6.0_33] 
    at org.apache.cxf.transport.http.HTTPConduit.setupURL(HTTPConduit.java:700) ~[cxf- 
    bundle-2.6.0.jar:2.6.0] 
    at org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:474) ~[cxf- 
    bundle-2.6.0.jar:2.6.0] 
    at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46) ~[cxf-api-2.6.0.jar:2.6.0] 
    ... 43 common frames omitted 

这里是我的Spring XML文件中的摘录:

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:http="http://cxf.apache.org/transports/http/configuration" 
xmlns:context="http://www.springframework.org/schema/context" 
xmlns:jaxws="http://cxf.apache.org/jaxws" \ 
xmlns:sec="http://cxf.apache.org/configuration/security" 
xmlns:cxf="http://cxf.apache.org/core" 
xsi:schemaLocation=" 
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-3.1.xsd 
http://www.springframework.org/schema/beans  
http://www.springframework.org/schema/beans/spring-beans.xsd 
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd 
http://cxf.apache.org/transports/http/configuration 
http://cxf.apache.org/schemas/configuration/http-conf.xsd 
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-3.1.xsd 
http://cxf.apache.org/configuration/security 
http://cxf.apache.org/schemas/configuration/security.xsd 
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">  
<http:conduit name="https://.*"> 
<http:tlsClientParameters> 
<sec:trustManagers> 
<sec:keyStore type="JKS" password="${jkspass}" file="${jkslocation}" /> 
</sec:trustManagers> 
</http:tlsClientParameters> 
<http:client AutoRedirect="true" Connection="Keep-Alive" /> 
</http:conduit> 
<!-- Member Service --> 
<!--<bean id="memberServiceProxy" class="com.loyalty.tp.ets.common.member.ws.Member" 
factory-bean="memberServiceProxyFactory" factory-method="create"/> --> 
<jaxws:client id="memberServiceProxy" 
serviceClass="com.loyalty.tp.ets.common.member.ws.Member" 
address="${member.service.uri}"> 
<jaxws:features> 
<bean class="org.apache.cxf.feature.LoggingFeature" /> 
</jaxws:features> 
</jaxws:client> 
<bean id="memberServiceProxyFactory" 
class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean"> 
<property name="serviceClass" value="com.loyalty.tp.ets.common.member.ws.Member"/> 
<property name="address" value="${member.service.uri}"/> 
</bean> 
<!-- ETS Collector Service --> 
<bean id="collectorServiceProxy" class="com.loyalty.tp.ets.collectorservice.Collector" 
factory-bean="collectorServiceProxyFactory" factory-method="create"/> 

<bean id="collectorServiceProxyFactory" 
class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean"> 
<property name="serviceClass" value="com.loyalty.tp.ets.collectorservice.Collector"/> 
<property name="address" value="${ets.collector.service.uri}"/> 
</bean> 
</beans> 

它解决了${jksLocation}${jkspassword}就好了。这里发生了什么 ?

+1

你想出了一个解决方案?我有同样的问题。 –

回答

0

这似乎是特定版本的cxf和春天之间的不兼容性,试着找到一对夫妇一起工作。

我有骆驼CXF:2.12.0.redhat-610379由此带来CXF 2.7.0和春季3.2.8.RELEASE,一切都OK