【问题标题】:Can't transform a Source of type javax.xml.transform.stax.StAXSource Camel-Springws无法转换 javax.xml.transform.stax.StAXSource Camel-Springws 类型的源
【发布时间】:2015-10-05 17:46:39
【问题描述】:

在服务器中部署战争时偶尔会遇到此问题。问题在重新启动时得到解决。有时需要多次重启才能解决问题。

我在上下文中使用了以下 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 系统属性。

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

【问题讨论】:

    标签: java apache-camel spring-ws


    【解决方案1】:

    Camel-Springws 提供了直接指定transformer factory的选项,解决了这个问题。

    在你的 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多