处理Spring集成Web服务出站网关中的MessageHandlingException

时间:2014-01-11 07:53:23

标签: spring-integration

我的应用程序的SI配置如下:

<oxm:jaxb2-marshaller id="myMarshaller" contextPath="com.test" />

<int:gateway id="servgateway" service-interface="com.services.ServiceGateway" error-channel="error-channel">        
    <int:method name="getSum" request-channel="reqChannel" reply-channel="respChannel">         
    </int:method>
</int:gateway>
<int:chain input-channel="reqChannel" output-channel="respChannel">
    <int-ws:outbound-gateway uri="http://SER:IP/mokFault" message-sender="httpSender" marshaller="myMarshaller" 
    message-factory="soapMessageFactory"         />  
</int:chain>
<int:channel id="error-channel" />  

<int:service-activator input-channel="error-channel" ref="rrrorHandler" method="handleError"/>

此端点(SER:IP / mokFault)指向一个SOAP Fault模拟。

在Activator中处理所有异常。它的方法看起来像

public void handleError(Message<?> message) {

}

我尝试用juint测试它,它工作正常,并且异常(SOAP Fault)没有进入控制台。

如果我从我的网络应用程序中调用此网关(servgateway),我会得到适当的响应 但IBM WS服务器控制台中会出现异常(SOAP Fault)。我没有在代码中使用任何异常/记录器的printStackTrace。

只有这个Spring集成Web服务出站网关异常(SOAP Fault,UnKnownHost,Unmarshall ......)才会进入服务器控制台。

是否需要更多配置才能从控制台中删除所有这些异常?

我使用的是Spring集成版本2.2.3.RELEASE。

以下是例外列表:

GatewayProxyF W org.springframework.integration.gateway.MessagingGatewaySupport doSendAndReceive failure occurred in gateway sendAndReceive
                             org.springframework.integration.MessageHandlingException: error occurred in message handler [org.springframework.integration.ws.MarshallingWebServiceOutboundGateway#756f756f]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:79)
at org.springframework.integration.handler.MessageHandlerChain$1.send(MessageHandlerChain.java:154)
at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendMessage(AbstractReplyProducingMessageHandler.java:216)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:200)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:165)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:159)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:141)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73)
at org.springframework.integration.handler.MessageHandlerChain.handleMessageInternal(MessageHandlerChain.java:137)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73)
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:115)
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:102)
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128)
at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
at org.springframework.integration.core.MessagingTemplate.doSendAndReceive(MessagingTemplate.java:318)
at org.springframework.integration.core.MessagingTemplate.sendAndReceive(MessagingTemplate.java:239)
at org.springframework.integration.core.MessagingTemplate.convertSendAndReceive(MessagingTemplate.java:274)
at org.springframework.integration.gateway.MessagingGatewaySupport.doSendAndReceive(MessagingGatewaySupport.java:224)
at org.springframework.integration.gateway.MessagingGatewaySupport.sendAndReceive(MessagingGatewaySupport.java:203)
at org.springframework.integration.gateway.GatewayProxyFactoryBean.invokeGatewayMethod(GatewayProxyFactoryBean.java:306)
at org.springframework.integration.gateway.GatewayProxyFactoryBean.doInvoke(GatewayProxyFactoryBean.java:269)
at org.springframework.integration.gateway.GatewayProxyFactoryBean.invoke(GatewayProxyFactoryBean.java:260)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy54.getSum(Unknown Source)
......................
Caused by: org.springframework.ws.soap.client.SoapFaultClientException: 1
    at org.springframework.ws.soap.client.core.SoapFaultMessageResolver.resolveFault(SoapFaultMessageResolver.java:37)
    at org.springframework.ws.client.core.WebServiceTemplate.handleFault(WebServiceTemplate.java:738)
    at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:564)

1 个答案:

答案 0 :(得分:0)

如您所见,它是WARN,因此只需从日志配置中关闭org.springframework.integration.gateway类别(甚至整个org.springframework)的'警告'。或者来自WAS console,如果您使用它(通过您的评论)。