标签: spring-cxf

Spring 属性占位符未在 jaxws:client (cxf) 地址属性中解析

Environment:

    Spring MVC : 4.1.7.RELEASE
    CXF: 3.0.0
    java: 1.8

web.xml --- loads appContext.xml (spring cofigs) & cxfContext.xml (configs for cxf)

spring-servlet.xml --- loading the spring mvc configs.
Run Code Online (Sandbox Code Playgroud)

我正在使用以下方式加载属性文件。

@Configuration

    @PropertySource(value = { "classpath:config.properties" })
    public class Configuration {
        @Bean
        public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
            return new PropertySourcesPlaceholderConfigurer();
        }
    }
Run Code Online (Sandbox Code Playgroud)

属性正在得到解决,除了一种情况之外没有任何问题。

我将 CXF 用于 Web 服务,并且在使用时地址属性没有得到解析"${addressVal}"。xml 中的所有其他属性都已加载,除了"jaxws:client".

<jaxws:client id="port"
        serviceClass="com.service.Myclass"
        address="${addressVal}" />
Run Code Online (Sandbox Code Playgroud)
  1. 问题出在哪儿。我做错了什么。

  2. servlet 上下文/应用程序上下文加载问题?

请指教。

spring cxf spring-mvc jax-ws spring-cxf

6
推荐指数
1
解决办法
1485
查看次数

标签 统计

cxf ×1

jax-ws ×1

spring ×1

spring-cxf ×1

spring-mvc ×1