Ad

Failed To Convert Property Value Of Type 'java.util.ArrayList' To Required Type 'javax.xml.ws.handler.HandlerResolver'

- 1 answer

I'm trying to define the 'handlerResolver' property of a service interface bean in Spring. I need to pass the property a list of two handlers. I've tried all kinds of combinations, but currently I'm getting this error:

Caused by: java.lang.IllegalStateException: Cannot convert value of type [java.util.ArrayList] to required type [javax.xml.ws.handler.HandlerResolver] for property 'handlerResolver': no matching editors or conversion strategy found

My definition looks like this:

<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>
Ad

Answer

The handlerResolver property of your bean isn't of type List, it's of type HandlerResolver, so trying to configure it as a list in your XML is what's failing.

Ad
source: stackoverflow.com
Ad