Announcement Announcement Module
Collapse
No announcement yet.
Transformer not working with HttpRequestHandlingMessagingGateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    ok.will upgrade.

    Comment


    • #17
      Yes; this is available in 2.0.5 ... https://jira.springsource.org/browse/INT-1890

      Comment


      • #18
        hey oleg did as u said.
        created an errorchannel and an error handler.

        Code:
        <int:channel id="demoRequestChannel" />
        	<int:channel id="demoResponseChannel" />
        	<int:channel id="demoerrorChannel" />
        
        	<int-http:inbound-gateway id="demoAdapter.htm"
        		name="/demoAdapter.htm" request-channel="demoRequestChannel"
        		reply-channel="demoResponseChannel" supported-methods="GET,POST"
        		extract-reply-payload="true" error-channel="demoerrorChannel" />
        
        	<int:transformer ref="messageReceiver" method="receive" input-channel="demoRequestChannel" />
        
        	<int:service-activator ref="errorHandler" input-channel="demoerrorChannel" />
        
        	<bean id="errorHandler" class="com.test.ErrorClass" />
        This code worked and i got a response.
        But when i try to use the transformer in a chain.It again starts given me the exception.

        This the code which gives me an exception
        Code:
        <int-http:inbound-gateway id="demoAdapter.htm" name="/demoAdapter.htm" request-channel="demoRequestChannel" reply-channel="demoResponseChannel" supported-methods="GET,POST" extract-reply-payload="true" error-channel="demoErrorChannel"/>
        
        	<int:chain input-channel="demoRequestChannel">
        		<int:transformer ref="messageReceiver" method="receive"/>
        		<int:header-value-router header-name="type">
        			<int:mapping value="login" channel="loginChannel" />
        			<int:mapping value="report" channel="reportChannel" />
        		</int:header-value-router>
        	</int:chain>
        	<int:service-activator ref="responseHandler" input-channel="serializationChannel" /> 
        
                <int:service-activator ref="errorHandler" input-channel="demoErrorChannel" />
        	
                 <bean id = "errorHandler" class="com.test.TransformerClass"/>
        The login channel and report channel pass data to the serializationchannel which returns a modelandview.
        Please help.
        Cant understand where am i going wrong.
        What could be the problem?
        Last edited by annuk; Nov 16th, 2011, 11:38 PM.

        Comment


        • #19
          Even after i upgraded to spring 2.0.5 the problem still persists.

          Comment


          • #20
            hi i dont think i can help u because iam facing like the same prob

            Comment


            • #21
              The problem is not in the chain. In your chain configuration you have router which is where the transformed message goes to and than it gets routed. Routed where? I can't see any component listening on 'loginChannel' or 'reportChannel' so you might not be including the whole configuration. But just to prove that transformer works in the chain the same way as outside of the chain do this:
              Code:
              <int:channel id="demoRequestChannel" />
              	<int:channel id="demoResponseChannel" />
              	<int:channel id="demoerrorChannel" />
              
              	<int-http:inbound-gateway id="demoAdapter.htm"
              		name="/demoAdapter.htm" request-channel="demoRequestChannel"
              		reply-channel="demoResponseChannel" supported-methods="GET,POST"
              		extract-reply-payload="true" error-channel="demoerrorChannel" />
                      <int:chain input-channel="demoRequestChannel" >
                          <int:transformer ref="messageReceiver" method="receive" />
                      <int:chain>
              	
              
              	<int:service-activator ref="errorHandler" input-channel="demoerrorChannel" />
              
              	<bean id="errorHandler" class="com.test.ErrorClass" />
              Last edited by oleg.zhurakousky; Nov 17th, 2011, 07:05 AM.

              Comment


              • #22
                Hey oleg,
                Did as u said.

                This is my config.
                Code:
                <int:channel id="demoRequestChannel" />
                	<int:channel id="demoResponseChannel" />
                	<int:channel id="demoerrorChannel" />
                
                	<int-http:inbound-gateway id="demoAdapter.htm"
                		name="/demoAdapter.htm" request-channel="demoRequestChannel"
                		reply-channel="demoResponseChannel" supported-methods="GET,POST"
                		extract-reply-payload="true" error-channel="demoerrorChannel" />
                	<int:chain input-channel="demoRequestChannel">
                		<int:transformer ref="messageReceiver" method="receive" />
                	</int:chain>
                	<int:service-activator ref="errorHandler"
                		input-channel="demoerrorChannel" />
                
                	<bean id="errorHandler" class="com.test.TransformerClass" />
                But got this:
                Code:
                 WARN 2011-11-17 18:50:27,600 [http-8080-1] (MessagingGatewaySupport.java:240) (doSendAndReceive) - failure occurred in gateway sendAndReceive
                org.springframework.integration.support.channel.ChannelResolutionException: no output-channel or replyChannel header available
                	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:166)
                	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:125)
                	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:119)
                	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:101)
                	at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
                	at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:110)
                	at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
                	at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
                	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
                	at org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel.send(MessageHandlerChain.java:210)
                	at org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel.send(MessageHandlerChain.java:203)
                	at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
                	at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
                I have component which listen to the loginChannel and the reportChannel.
                The message flows properly till the end.But it is not sending the response back to the client.

                The messages travel till my response handler
                Code:
                <int:service-activator ref="responseHandler" input-channel="serializationChannel" output-channel="demoResponseChannel" />
                This is my response handler class
                Code:
                public String handleResponse(Message<?> message)
                	{
                
                         		log.info("In SimpleResponseHandler/handleResponse...");
                		
                			log.info("in ReplySender sendMessage " + message.getPayload());
                
                			return "Successs";
                		
                
                	}
                Please help.

                Comment


                • #23
                  remove output-channel="demoResponseChannel" from the chain

                  Comment


                  • #24
                    removed it and checked.
                    Still got the same error.
                    Actually i added the output-channel after i got the error.
                    Getting exceptions in both the cases.
                    With the reply channel and without it.

                    Comment


                    • #25
                      I am not getting a response back.
                      Even the error channel is not sending back the response.

                      Even i tried doing this:
                      Code:
                      <int:service-activator ref="errorHandler"  input-channel="demoerrorChannel" output-channel="demoResponseChannel" />
                      It goes into the error Handler class but it is not sending the response back.
                      This is the whole exception im getting
                      Code:
                       INFO 2011-11-17 19:08:32,178 [http-8080-1] (EventDrivenConsumer.java:75) (logComponentSubscriptionEvent) - Adding {bridge:null} as a subscriber to the 'demoResponseChannel' channel
                       INFO 2011-11-17 19:08:32,179 [http-8080-1] (AbstractSubscribableChannel.java:46) (subscribe) - Channel 'demoResponseChannel' has 1 subscriber(s).
                       INFO 2011-11-17 19:08:32,179 [http-8080-1] (AbstractEndpoint.java:87) (start) - started [email protected]54e6
                       INFO 2011-11-17 19:08:32,186 [http-8080-1] (SimpleMessageReceiver.java:28) (receive) - In SimpleMessageReceiver/recieve...
                      Request Received::{content=[{"data":{"Code":"0000055073","Division":"10"},"entity":"invoice","action":"create","type":"reports"}]}
                       WARN 2011-11-17 19:08:32,194 [http-8080-1] (MessagingGatewaySupport.java:240) (doSendAndReceive) - failure occurred in gateway sendAndReceive
                      org.springframework.integration.MessageHandlingException: no replyChannel header available
                      	at org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel.send(MessageHandlerChain.java:214)
                      	at org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel.send(MessageHandlerChain.java:203)
                      	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:176)
                      	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:160)
                      	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:125)
                      	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:119)
                      	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:101)
                      	at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
                      	at org.springframework.integration.handler.MessageHandlerChain.handleMessageInternal(MessageHandlerChain.java:137)
                      	at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
                      	at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:110)
                      	at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
                      	at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
                      	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
                      	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.gateway.MessagingGatewaySupport.doSendAndReceive(MessagingGatewaySupport.java:233)
                      	at org.springframework.integration.gateway.MessagingGatewaySupport.sendAndReceiveMessage(MessagingGatewaySupport.java:207)
                      	at org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport.doHandleRequest(HttpRequestHandlingEndpointSupport.java:271)
                      	at org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway.handleRequest(HttpRequestHandlingMessagingGateway.java:95)
                      	at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
                      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:774)
                      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
                      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
                      	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
                      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
                      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
                      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                      	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                      	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                      	at java.lang.Thread.run(Thread.java:662)
                      In ERROR HANDLER
                      Nov 17, 2011 7:08:32 PM org.apache.catalina.core.StandardWrapperValve invoke
                      SEVERE: Servlet.service() for servlet dispatcher threw exception
                      org.springframework.integration.MessageHandlingException: no replyChannel header available
                      	at org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel.send(MessageHandlerChain.java:214)
                      	at org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel.send(MessageHandlerChain.java:203)
                      	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:176)
                      	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:160)
                      	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:125)
                      	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:119)
                      	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:101)
                      	at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
                      	at org.springframework.integration.handler.MessageHandlerChain.handleMessageInternal(MessageHandlerChain.java:137)
                      	at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
                      	at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:110)
                      	at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
                      	at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
                      	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
                      	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.gateway.MessagingGatewaySupport.doSendAndReceive(MessagingGatewaySupport.java:233)
                      	at org.springframework.integration.gateway.MessagingGatewaySupport.sendAndReceiveMessage(MessagingGatewaySupport.java:207)
                      	at org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport.doHandleRequest(HttpRequestHandlingEndpointSupport.java:271)
                      	at org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway.handleRequest(HttpRequestHandlingMessagingGateway.java:95)
                      	at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
                      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:774)
                      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)

                      Comment


                      • #26
                        I'll look later on

                        Comment


                        • #27
                          Thanks a lot
                          Last edited by annuk; Nov 18th, 2011, 08:40 AM.

                          Comment


                          • #28
                            Hi,
                            Any updates???
                            Thanks...

                            Comment


                            • #29
                              hi Oleg,

                              Any updates on this issue?

                              Regards,
                              Annuk

                              Comment


                              • #30
                                Hey Oleg,

                                Any more updates on this issue.
                                Thanks in advance
                                Regards
                                Annuk

                                Comment

                                Working...
                                X