无法转换类型' java.util.ArrayList'的属性值要求的类型' javax.xml.ws.handler.HandlerResolver'

时间:2014-08-08 18:38:26

标签: java xml spring

我试图定义' handlerResolver' Spring中服务接口bean的属性。我需要传递属性两个处理程序的列表。我尝试了各种组合,但目前我收到了这个错误:

引起:java.lang.IllegalStateException:无法将类型[java.util.ArrayList]的值转换为属性所需的类型[javax.xml.ws.handler.HandlerResolver]' handlerResolver':no找到匹配的编辑器或转换策略

我的定义如下:

<bean id="CustomerOffers_Service" class="com.td.springframework.ext.JaxWsPortProxyFactoryBean"
    scope="singleton">
    <property name="serviceName">
        <value>CustomerOffersService</value> 
    </property>
    <property name="namespaceUri">
        <value>urn:wsc.td.com/cco/wsdl/2011/05/01</value>
    </property>
    <property name="serviceInterface">
        <value>com.td.wsc.cco.ns20110501.CustomerOffers</value>
    </property>
    <property name="connectionTimeout">
        <value>${cco.connectionTimeout}</value>
    </property>
    <property name="writeTimeout">
        <value>${cco.writeTimeout}</value>
    </property>
    <property name="responseTimeout">
        <value>${cco.responseTimeout}</value>
    </property>
    <property name="jaxbContext">
        <value>com.td.wsc.cco.ns20110501.xml</value>
    </property>
    <property name="portName">
        <value>SoapPort_20110501</value>
    </property>
    <property name="useEnvName">
        <value>true</value>
    </property>
    <property name="endpointAddress">
        <value>${com.td.wsc.cco.ns20110501_HOSTNAME}</value>
    </property>
    <property name="handlerResolver">
      <list>
          <ref bean="com_td_dcc_wss_off_OfferHandlerResolver"/>
          <ref bean="com_td_wsc_prs_ns20100601-HandlerResolver"/>
      </list>
    </property>
</bean>

<bean id="com_td_dcc_wss_off_OfferHandlerResolver" class="com.td.wss.dcc.off.v1.OfferHandlerResolver"/>

<bean id="com_td_wsc_prs_ns20100601-HandlerResolver" lazy-init="true" class="com.td.wau.waux.jws.HandlerResolverBean">
    <property name="handlers">
        <list>
            <ref local="com_td_wau_waux_jws_OutboundHeaderHandler-Handler" />   
        </list>
    </property>
</bean>

<bean id="com_td_wau_waux_jws_OutboundHeaderHandler-Handler" lazy-init="true" class="com.td.wau.waux.jws.OutboundHeaderHandler">
    <property name="enableTraceabilityId">
        <value>true</value>
    </property>
    <property name="enableConsumerAppId">
        <value>true</value>
    </property>
</bean>

1 个答案:

答案 0 :(得分:1)

bean的handlerResolver属性不是List类型,它的类型为HandlerResolver,因此尝试将其配置为XML中的列表是失败的原因。