Announcement Announcement Module
Collapse
No announcement yet.
Http inbound and outbound gateway - exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Http inbound and outbound gateway - exception

    I took the http example and worked it in but I'm getting the following error:
    HTML Code:
    org.springframework.beans.ConversionNotSupportedException: Failed to convert value of type 'org.springframework.http.HttpStatus' to required type 'java.lang.String'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.http.HttpStatus] to required type [java.lang.String]: no matching editors or conversion strategy found
    Here is my setup for the http outbound gateway:

    Code:
    <int:gateway id="requestGateway" 
    	             service-interface="com.test.RequestGateway"
    	             default-request-channel="requestChannel"/>
    	
     <int:channel id="requestChannel"/>
    
     <int-http:outbound-gateway request-channel="requestChannel" 
    					           url="http://localhost:8080/http/someService/test"
    					           http-method="POST"
    					           expected-response-type="java.lang.String"/>
    Here is my setup for http inbound gateway and web.xml:

    web.xml:

    Code:
    <servlet>
     <servlet-name>httpTest</servlet-name>
     <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
    </servlet>
    	
    <servlet-mapping>
     <servlet-name>httpTest</servlet-name>
     <url-pattern>/someService/*</url-pattern>
    </servlet-mapping>
    httpTest-servlet.xml:

    Code:
    <bean class="org.springframework.integration.http.inbound.UriPathHandlerMapping" />
     <int-http:inbound-gateway request-channel="receiveChannel"
                              path="/someService/test"
                              supported-methods="POST"/>
                              
     <int:channel id="receiveChannel"/>	
    	
     <int:service-activator input-channel="receiveChannel" expression="payload + ' from the other side'"/>
    Any suggestions?
    Thanks
    Netta

  • #2
    Not sure why you're seeing that error; I would expect to see Exception in thread "main" org.springframework.web.client.HttpClientErrorExce ption: 404 Not Found

    Your path on the inbound gateway should be path="/test"

    Comment


    • #3
      Originally posted by Gary Russell View Post
      Not sure why you're seeing that error; I would expect to see Exception in thread "main" org.springframework.web.client.HttpClientErrorExce ption: 404 Not Found

      Your path on the inbound gateway should be path="/test"
      Thanks for the answer. I changed it and I'm still receiving the same error.

      Comment


      • #4
        I suggest you turn on DEBUG logging on both client and server; it should become obvious what the problem is.

        Comment


        • #5
          Hello

          Is your server web-app realy mapped to "/http" contenxt?
          What heppened when you are calling the same URL from any other web-client like Internet Browser?

          Take care,
          Artem Bilan

          Comment


          • #6
            ok I had a conflicting channel and a redirection issue. Now that those are solved I'm getting this error:

            [No adapter for handler [org.springframework.integration.http.inbound.HttpR equestHandlingMessagingGateway#0]: Does your handler implement a supported interface like Controller?] with root cause
            javax.servlet.ServletException: No adapter for handler [org.springframework.integration.http.inbound.HttpR equestHandlingMessagingGateway#0]: Does your handler implement a supported interface like Controller?

            Comment


            • #7
              I solved the problem. I was missing the bean:

              <bean class="org.springframework.web.servlet.mvc.HttpReq uestHandlerAdapter"/>

              Comment


              • #8
                out of curiosity, the http example you provided doesn't have the bean HttpRequestHandlerAdapter, at least not that I've found. How does it work without it?

                Comment

                Working...
                X