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

  • Transformer not working with HttpRequestHandlingMessagingGateway

    Hi,

    I am using an http inboundgateway for sending a request to the server and for listening a response back on the client.
    The configuration works fine if i use a service activator.
    But when i use a transformer instead of a service activator it gives me an exception.

    Cant i use a transformer with http inboundgateway?
    This is my working config:
    Code:
    <bean id=adapter.htm" name="/adapter.htm"
    		class="org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway">
    		<constructor-arg value="true" />
    		<property name="requestChannel" ref="demoRequestChannel" />
    		<property name="replyChannel" ref="demoResponseChannel" />
    		<property name="supportedMethodNames">
    			<list>
    				<value>GET</value>
    				<value>POST</value>
    			</list>
    		</property>
    	</bean>
    
    <int:chain input-channel="demoRequestChannel">
    		<int:service-activator ref="messageReceiver" method="receive" />
    		<int:header-value-router header-name="type">
    			<int:mapping value="login" channel="loginChannel" />
    			 <int:mapping value="transaction" channel="transactionChannel" />
    		</int:header-value-router>	
    </int:chain>
    
    <int:service-activator ref="responseHandler" input-channel="serializeChannel" output-channel="demoResponseChannel" />
    The loginChannel and transactionChannel pass data to the serializeChannel channel which passes data to the demoResponseChannel.

    But when i use a transformer instead of a service activator it throws an exception

    Code:
    <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="transaction" channel="transactionChannel" />
    		</int:header-value-router>	
    </int:chain>
    This is the exception im getting.

    Code:
    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:44)
    	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.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)
    Where am i going wrong..
    I need a transformer to convert my message into a bean.
    Thanks in advance.

  • #2
    What version of SI you are using and why are you using <bean> configuration instead of <int-http:inbound-gateway. . ./>?

    Yes you can use service-activator, transformer or any other component with HTTP inbound gateway. The error message basically states that there was a reply but the framework could not figure out where to send it to since no output-channel or replyChannel header was specified.
    But based on your configuration is is unclear what is wrong, so letting us know what version of SI you are using would help.

    Comment


    • #3
      Hey Oleg,

      Thanks for your reply.
      Currently im using Spring 3.0 and spring integration 2.0
      Code:
      <beans xmlns="http://www.springframework.org/schema/beans"
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
      	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      		http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
      		http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd
      		http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http-2.0.xsd
      		http://www.springframework.org/schema/integration/stream
            	http://www.springframework.org/schema/integration/stream/spring-integration-stream-2.0.xsd"
      	xmlns:int="http://www.springframework.org/schema/integration"
      	xmlns:int-file="http://www.springframework.org/schema/integration/file"
      	xmlns:int-http="http://www.springframework.org/schema/integration/http">
      I first tried using the <int-http:inbound-gateway. . ./> but i was not able to receive a response.
      Thus i used a bean and got a response.
      Even if i use the <int-http:inbound-gateway. . ./> and use the transformer i get the error
      Code:
      <int-http:inbound-gateway id="adapter.htm" name="/adapter.htm" request-channel="demoRequestChannel" reply-channel="demoResponseChannel" supported-methods="GET,POST" extract-reply-payload="true" />
      In my current case the code works fine with a service activator but not with a transformer.

      I am returning a Message<String> from the transformer/Service activator.

      This is my transformer/Service activator class:
      Code:
      public Message<String> receive(Message<Map<String, List<String>>> smsData)
      	{
      		try
      		{
      
      			log.info("In Receiver/recieve...");
      
      			log.info("Message Received::" + smsData);
      			
      			String data = getMessageData(smsData);
      
      			JSONObject jsonObject = new JSONObject(data);
      
      			String type = jsonObject.getString(TYPE);
      
      			return MessageBuilder.withPayload(data).build();
      		}
      		catch (JSONException e)
      		{
      			e.printStackTrace();
      		}
      
      		return null;
      	}
      Please help.
      Thanks in advance.
      Last edited by annuk; Nov 15th, 2011, 02:49 AM.

      Comment


      • #4
        Well, based on your code, your implementation can actually return 'null' which violates the contract of the transformer. Transformers can never return null. ServiceActivator can return null which results in no message sent back, so I suspect that is where your problem is and possibly why you had problem getting a reply with <int-http:inbound-gateway.../>

        Typically you re-throw exception within your custom implementation of any endpoint and SI will generate an ErrorMessage that will be sent to the replyChannel/errorChannel, thus guaranteeing a reply in the case where the entry point is gateway

        Comment


        • #5
          hey oleg,

          I tried returning a message in exception and changed the code to:
          Code:
          @Override
          	public Message<String> receive(Message<Map<String, List<String>>> smsData)
          	{
          		try
          		{
          
          			log.info("In MessageReceiver/recieve...");
          
          			log.info("Message Received::" + smsData);
          			
          			String data = getMessageData(smsData);
          
          			JSONObject jsonObject = new JSONObject(data);
          
          			String type = jsonObject.getString(TYPE);
          
          			return MessageBuilder.withPayload(data).setHeader("type", type).build();
          		}
          		catch (Exception e)
          		{
          			e.printStackTrace();
          			return MessageBuilder.withPayload("Error").build();
          		}
          
          	}
          and my configuration is:
          Code:
          <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>
          But still got the following error:

          Code:
           WARN 2011-11-15 19:11:42,446 [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:44)
          	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.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.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:44)
          Thanks..

          Comment


          • #6
            Well, you are building a new Message that has no replyChannel set.
            Why don't you just let the error propagate?

            Comment


            • #7
              hi thanks for your reply,

              Is it wrong to send the error message to my class?

              Code:
              catch (Exception e)
              		{
              			e.printStackTrace();
              			return MessageBuilder.withPayload("Error").build();
              		}
              I am not returning null which is the main criteria for a transformer.
              when a transformed is attached in the configuration chain it gives an exception.

              The request goes into the transformer does all the processing but it is not getting the response channel.

              Please help.

              Comment


              • #8
                Of course you can return the ErrorMessage, but SI would generate the ErrorMessage for you.
                May be you should explain what are you trying to accomplish

                Comment


                • #9
                  Hi Oleg,

                  Thanks for your reply...

                  I have a system which accepts request from a client,processes it and sends the response back to the client.
                  The system works fine with a service activator.
                  But the moment i replace the service activator with a transformer it gives me an exception.
                  My server receives the request properly,processes it.But while sending the response back to the client i am getting the exception.

                  The code works but the class just transforms a message.So i want to declare it as Transformer and not as service activator.
                  The messages are passed correctly from one channel to another except to the reply channel of the inboundgateway.

                  I wrote a demo config with just the transformer class and passed it to the reply channel.But still got the same error.

                  Code:
                  <?xml version="1.0" encoding="UTF-8"?>
                  <beans xmlns="http://www.springframework.org/schema/beans"
                  	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
                  	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                  		http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
                  		http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd
                  		http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http-2.0.xsd
                  		http://www.springframework.org/schema/integration/stream
                        	http://www.springframework.org/schema/integration/stream/spring-integration-stream-2.0.xsd"
                  	xmlns:int="http://www.springframework.org/schema/integration"
                  	xmlns:int-file="http://www.springframework.org/schema/integration/file"
                  	xmlns:int-http="http://www.springframework.org/schema/integration/http">
                  
                  	<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"/>
                  
                  	<int:transformer ref="messageReceiver" method="receive" input-channel="demoRequestChannel" output-channel="demoResponseChannel"/>
                  		
                  	
                  	
                  </beans>
                  Error:
                  Code:
                   WARN 2011-11-16 11:50:22,202 [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:44)
                  	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)
                  Thanks in advance.
                  Regards,
                  Annuk
                  Last edited by annuk; Nov 16th, 2011, 01:21 AM.

                  Comment


                  • #10
                    Hi Oleg,

                    I even tried doing this
                    Code:
                    	<int:channel id="demoRequestChannel" />
                    	<int:channel id="demoResponseChannel" />
                    	<int:channel id="demotransformChannel"/>
                    	
                    	<int-http:inbound-gateway id="demoAdapter.htm" name="/demoAdapter.htm" request-channel="demoRequestChannel" reply-channel="demoResponseChannel" supported-methods="GET,POST" extract-reply-payload="true"/>
                    
                    	<int:service-activator ref="messageReceiver" method="receive" input-channel="demoRequestChannel" output-channel="demotransformChannel"/>
                    		
                    	<int:transformer id="transform" input-channel="demotransformChannel"  output-channel="demoResponseChannel">
                    	 <bean name="transformers" class="com.test.TransformerClass"/>
                    	</int:transformer>
                    My Transformer class:
                    Code:
                    public class TransformerClass
                    {
                    
                    	@Transformer
                    	public Message<String> transform(Message<String> message)
                    	{
                    		System.out.println("In TRansformer ");
                    		return MessageBuilder.withPayload("transformer").build();
                    	}
                    }
                    But still got the same error message.It goes into the transformer class but does not return any response.
                    Why is it behaving strangely with transfomer?
                    Regards,
                    Annuk

                    Comment


                    • #11
                      Ok,i see you config from the previous post
                      Here is what happens. Whenever exception happens in the transformer 2 things happen
                      1. No reply message is generated to go to 'demoResponseChannel'
                      2. The Exception is propagated back to the HTTP Inbound gateway

                      And that is exactly what should happen.

                      First, for you sample you don't need to define reply-channel on the gateway or output-channel on the transformer. I mean it doesn't hurt but it is not necessary since inbound-gateway will create a 'replyChannel' which will be passed through MessageHeaders.

                      The problem is with the fact that when the inbound-gateway receives exception you have no way of handling it. What you might want to do is define error-channel and attach a subscriber to that channel that will deal with it. THis would be the proper way of dealing with exceptions.
                      Code:
                      <int-http:inbound-gateway id="demoAdapter.htm" name="/demoAdapter.htm" request-channel="demoRequestChannel"  supported-methods="GET,POST" extract-reply-payload="true" error-channel="myErrorChannel"/>
                      
                      <int:transformer ref="messageReceiver" method="receive" input-channel="demoRequestChannel" />
                      
                      <int:service-activator id="errorHandler" input-channel="myErrorChannel". . ./>
                      Now with the code above once the error has been received by the gateway it will be sent to the 'myErrorChannel' and processed by the 'errorHandler' service-activator which is no different that any other service-activator. IN the injected bean method all you need to do is receive ErrorMessage which contains MessagingException as a payload where you can see what the exception is as well as the original Message via MessagingException.getFailedMessage().
                      What happens next depends on the logic within such service-activator. If you return a successful reply (it might still be reply describing the error, but as long as it is not the exception), than the gateway will act as if nothing ever happened and will return the reply back to the user, otherwise exception will result in error type response

                      Comment


                      • #12
                        Hi,

                        I am doing as u said.
                        When i include the error-channel attribute to my int-http:inboundgateway it gives me this error on start up.

                        Code:
                        ERROR 2011-11-16 18:19:34,198 [main] (FrameworkServlet.java:314) (initServletBean) - Context initialization failed
                        org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [test/message-config.xml]
                        Offending resource: ServletContext resource [/WEB-INF/config/spring/springmvc-config.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 18 in XML document from ServletContext resource [/WEB-INF/config/spring/test/message-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'error-channel' is not allowed to appear in element 'int-http:inbound-gateway'.
                            at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
                            at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
                            at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
                            at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:218)
                            at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147)
                            at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)
                            at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
                            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
                            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
                            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
                            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
                            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
                            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
                            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
                            at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
                            at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
                            at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
                            at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
                            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
                            at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
                            at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
                            at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
                            at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
                            at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
                            at javax.servlet.GenericServlet.init(GenericServlet.java:212)
                            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
                            at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
                            at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
                            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4364)
                            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                            at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
                            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                            at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
                            at org.apache.catalina.core.StandardService.start(StandardService.java:516)
                            at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
                            at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
                            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                            at java.lang.reflect.Method.invoke(Method.java:597)
                            at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
                            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
                        Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 18 in XML document from ServletContext resource [/WEB-INF/config/spring/test/message-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'error-channel' is not allowed to appear in element 'int-http:inbound-gateway'.
                            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
                            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
                            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
                            at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:202)
                            ... 38 more
                        Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'error-channel' is not allowed to appear in element 'int-http:inbound-gateway'.
                            at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
                            at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
                            at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
                            at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
                            at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417)
                            at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3182)
                            at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2659)
                            at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2066)
                            at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(XMLSchemaValidator.java:725)
                            at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
                            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
                            at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
                            at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
                            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
                            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
                            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
                            at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
                            at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
                            at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
                            at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
                            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
                            ... 41 more
                        The config file does not show any errors:
                        This is my config file
                        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"/>

                        Comment


                        • #13
                          What version of SI you are using?

                          Comment


                          • #14
                            I am using Spring integration 2.0.3
                            These are the jars that i am using:
                            1.spring-integration-core-2.0.3.RELEASE.jar
                            2.spring-integration-event-2.0.3.RELEASE.jar
                            3.spring-integration-http-2.0.3.RELEASE.jar
                            4.spring-integration-httpinvoker-2.0.3.RELEASE.jar
                            5.spring-integration-stream-2.0.1.RELEASE.jar
                            6.spring-integration-ws-2.0.0.RELEASE.jar

                            Comment


                            • #15
                              Can you pleas upgrade to 2.0.5 (the latest release)?

                              Comment

                              Working...
                              X