6
我試圖在Spring-WS中定義一個Jaxb2Marshaller
bean來使用擴展XmlAdapter
的自定義適配器。我曾在一個XML文件中的以下:如何通過XML在Spring bean中設置Jaxb2Marshaller列表中的XmlAdapter?
<bean id="jaxb2Marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="classesToBeBound">
<list>
<!-- various classes to be bound... -->
</list>
</property>
<property name="schema" value="myschema.xsd" />
<property name="adapters">
<list>
<value>com.lmig.am.claims.clip.ContactAdapter</value>
</list>
</property>
</bean>
不過,我發現了以下錯誤:
Cannot convert value of type [java.lang.String] to required type [javax.xml.bind.annotation.adapters.XmlAdapter] for property 'adapters[0]': no matching editors or conversion strategy found
任何想法我做錯了嗎?謝謝!