2014-03-06 50 views
1

你好,這是我的SI配置:Spring集成,堆棧溢出錯誤

<!-- Inbound/Outbound Channels employeeSearchRequest--> 
    <int:channel id="accountRequest" /> 
    <int:channel id="accountResponse" /> 
    <int:channel id="catRequestChannel" /> 
    <int:channel id="mataccountRequest" /> 
    <int:channel id="errorChannel"/> 



    <int-http:inbound-gateway id="cwebAccountManagementGateway"  
     supported-methods="GET, POST" 
     request-channel="accountRequest" 
     reply-channel="accountResponse" 
     mapped-request-headers="*"  
     mapped-response-headers="*" 
     view-name="/policies" 

     path="/services/{class}/{method}" 
     reply-timeout="50000" 
error-channel="errorChannel"> 




     <int-http:header name="serviceClass" expression="#pathVariables.class"/> 
     <int-http:header name="serviceMethod" expression="#pathVariables.method"/> 

    </int-http:inbound-gateway> 


    <int:header-value-router input-channel="accountRequest" 
     header-name="state" 
     default-output-channel="accountRequest" resolution-required="false"> 
     <int:mapping value="MAT" 
      channel="mataccountRequest" /> 
      <int:mapping value="CAT" 
      channel="catRequestChannel" /> 

    </int:header-value-router> 

    <int:service-activator id="accountServiceActivator" 
       input-channel="mataccountRequest" 
       output-channel="accountResponse" 
       ref="serviceGatewayAdapter" 
       method="requestHandler" 
       send-timeout="60000"/> 

     <int:service-activator id="caRequestActivator" 
       input-channel="catRequestChannel" 
       output-channel="accountResponse" 
       ref="caServiceGatewayAdapter" 
       method="requestHandler" 
       send-timeout="60000"/> 

       <int:service-activator id="errorRequestActivator" 
       input-channel="errorChannel" 
       output-channel="accountResponse" 
       ref="errorGatewayAdapter" 
       method="errorHandler" 
       send-timeout="60000"/> 

當我把這個服務正在逐漸堆棧溢出exception.When我想在tomcat的這個項目中我得到這個STAK溢出異常當過我不要指定狀態參數作爲標題與CAT或MAT.But當我部署在Websphere服務器 即使通過狀態pareameter我得到堆棧溢出異常。請給一些解決方案.Follwing是整個堆棧跟蹤。我無法粘貼整個堆棧我正在粘貼堆棧跟蹤的一部分。

[3/6/14 9:37:25:819 EST] 0000012f ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: Spring Integration Services. Exception thrown : org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.StackOverflowError 
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:972) 
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) 
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) 
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) 
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1213) 
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1154) 
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145) 
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) 
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) 
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190) 
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130) 
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87) 
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:848) 
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:691) 
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:654) 
    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:526) 
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3673) 
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269) 
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:831) 
    at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478) 
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133) 
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:457) 
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515) 
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:300) 
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:271) 
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) 
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) 
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:556) 
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:606) 
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:979) 
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1064) 
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1560) 
Caused by: java.lang.StackOverflowError 
    at org.springframework.integration.support.MessageBuilder.setHeader(MessageBuilder.java:104) 
    at org.springframework.integration.support.MessageBuilder.copyHeaders(MessageBuilder.java:177) 
    at org.springframework.integration.support.MessageBuilder.<init>(MessageBuilder.java:62) 
    at org.springframework.integration.support.MessageBuilder.fromMessage(MessageBuilder.java:75) 
    at org.springframework.integration.history.MessageHistory.write(MessageHistory.java:68) 
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:149) 
    at org.springframework.integration.channel.interceptor.WireTap.preSend(WireTap.java:121) 
    at org.springframework.integration.channel.AbstractMessageChannel$ChannelInterceptorList.preSend(AbstractMessageChannel.java:227) 
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:152) 
    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.send(MessagingTemplate.java:149) 
    at org.springframework.integration.router.AbstractMessageRouter.handleMessageInternal(AbstractMessageRouter.java:145) 
    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.send(MessagingTemplate.java:149) 
    at org.springframework.integration.router.AbstractMessageRouter.handleMessageInternal(AbstractMessageRouter.java:145) 
    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.send(MessagingTemplate.java:149) 
    at org.springframework.integration.router.AbstractMessageRouter.handleMessageInternal(AbstractMessageRouter.java:145) 
    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.send(MessagingTemplate.java:149) 
    at org.springframework.integration.router.AbstractMessageRouter.handleMessageInternal(AbstractMessageRouter.java:145) 
    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.send(MessagingTemplate.java:149) 
    at org.springframework.integration.router.AbstractMessageRouter.handleMessageInternal(AbstractMessageRouter.java:145) 
    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.send(MessagingTemplate.java:149) 
    at org.springframework.integration.router.AbstractMessageRouter.handleMessageInternal(AbstractMessageRouter.java:145) 
    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 

回答

1

<int:header-value-router/> couses問題:他的default-output-channel是一樣的input-channel。因此,如果路由器沒有通過映射解析該信道,則將該消息發送到其default-output-channel,但是這裏該信道是用於獲得該路由器的消息的信道。由於accountRequestDirrect通道,所有工作都在同一個線程完成。它會導致StackOverflowError

只要改變default-output-channel任何其他適當途徑

+0

感謝豬頭...工作正常,這就是......我糾正了......但是當我從靜止控制檯嘗試致電與頭狀態「CAT」這個服務仍然沒有得到標題 –

+0

您好帕斯狀態作爲CAT從mozila休息控制檯但它不接受標題的情況下websphere.but tomcat工作正常....請給解決方案 –

+0

「其不接受標頭的情況下websphere」。所以,這個問題取決於IBM。我認爲WAS上應該有一個選項來允許/禁止自定義HTTP標頭。 –