2015-10-05 174 views
0

战争部署在服务器中时偶尔会遇到此问题。问题在重新启动时得到解决。有时需要多次重新启动才能解决问题。无法转换类型为javax.xml.transform.stax.StAXSource的源Camel-Springws

我用下面的bean配置在我的上下文

<bean id="baseCamelMarshallerWSTemplate" class="org.springframework.ws.client.core.WebServiceTemplate" scope="prototype"> 
    <constructor-arg ref="messageFactory" /> 
    <property name="transformerFactoryClass" value="com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"/> 
</bean> 

我已经添加了baseCamelMarshallerWSTemplate到springws端点配置如下:

from("spring-ws:rootqname:{http://example.com/}GetFoo?endpointMapping=#endpointMapping&webServiceTemplate=baseCamelMarshallerWSTemplate") 

但问题似乎发生。由于限制,无法将变压器工厂设置为com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl作为服务器中的java系统属性。

请提供任何其他解决方案。

回答

1

骆驼春天提供了一个选项,直接指定变压器工厂,它解决了问题。

在你的bean配置文件中,指定变压器工厂类使用

<bean id="transformerFactory" class="com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"/> 

的TransformerFactory中加入Springws端点配置如下:

spring-ws:rootqname:{http://services.com/ServiceV1.0}Request?endpointMapping=#endpointMapping&transformerFactory=#transformerFactory 
相关问题