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

  • nettad
    started a topic Http inbound and outbound gateway - exception

    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

  • nettad
    replied
    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?

    Leave a comment:


  • nettad
    replied
    I solved the problem. I was missing the bean:

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

    Leave a comment:


  • nettad
    replied
    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?

    Leave a comment:


  • Artem Bilan
    replied
    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

    Leave a comment:


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

    Leave a comment:


  • nettad
    replied
    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.

    Leave a comment:


  • Gary Russell
    replied
    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"

    Leave a comment:

Working...
X