Results 1 to 8 of 8

Thread: Http inbound and outbound gateway - exception

  1. #1

    Default 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. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    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"
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3

    Default

    Quote 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.

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    I suggest you turn on DEBUG logging on both client and server; it should become obvious what the problem is.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  5. #5
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    644

    Default

    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

  6. #6

    Default

    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?

  7. #7

    Default

    I solved the problem. I was missing the bean:

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

  8. #8

    Default

    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?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •