Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7582445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:26:11+00:00 2026-05-30T18:26:11+00:00

I am trying to setup a Spring Integration based Restful service. I am trying

  • 0

I am trying to setup a Spring Integration based Restful service. I am trying to avoid creating individual objects for request and response but instead use a HashMap for simple functions such as isUserAvailableForRegistration at service.

e.g

HashMap<String, String> isUserAvailableForRegistration(HashMap<String,String> request)

The following is the integration related context information:

<bean class="org.springframework.integration.http.inbound.UriPathHandlerMapping"/>

<int-http:inbound-gateway id="inboundGateway"
    request-channel="incoming" reply-channel="outgoing" 
    supported-methods="POST" reply-timeout="5000"
    path="/customer/isUserAvailable" />

<int:channel id="incoming" />
<int:channel id="outgoing" />

<int:service-activator id="activator" input-channel="incoming" ref="customerManagementGateway"
    method="isUserAvailableForRegistration" output-channel="outgoing" requires-reply="true" />

<int:object-to-json-transformer id="outgoingJsonConverter"
    input-channel="outgoing" />

<int:json-to-object-transformer id="incomingJsonConverter" input-channel="incoming" type="java.util.HashMap"  />

While I can successfully test that I could marshall HashMap to JSON successfully, I am missing the configuration to unmarshall JSON data into HashMap.

I get the following exception:

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.integration.dispatcher.AggregateMessageDeliveryException: All attempts to deliver Message to MessageHandlers failed. Multiple causes:
    failed to transform message
    org.springframework.expression.AccessException: Problem invoking method: public java.util.Map com.testapp.customer.CustomerManagementServiceActivator.isUserAvailableForRegistration(java.util.Map)
See below for the stacktrace of the first cause.
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

org.springframework.integration.dispatcher.AggregateMessageDeliveryException: All attempts to deliver Message to MessageHandlers failed. Multiple causes:
    failed to transform message
    org.springframework.expression.AccessException: Problem invoking method: public java.util.Map com.testapp.customer.CustomerManagementServiceActivator.isUserAvailableForRegistration(java.util.Map)
See below for the stacktrace of the first cause.
    org.springframework.integration.dispatcher.UnicastingDispatcher.handleExceptions(UnicastingDispatcher.java:164)
    org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:127)
    org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:101)
    org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
    org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
    org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
    org.springframework.integration.core.MessagingTemplate.doSendAndReceive(MessagingTemplate.java:318)
    org.springframework.integration.core.MessagingTemplate.sendAndReceive(MessagingTemplate.java:239)
    org.springframework.integration.gateway.MessagingGatewaySupport.doSendAndReceive(MessagingGatewaySupport.java:233)
    org.springframework.integration.gateway.MessagingGatewaySupport.sendAndReceiveMessage(MessagingGatewaySupport.java:207)
    org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport.doHandleRequest(HttpRequestHandlingEndpointSupport.java:378)
    org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway.handleRequest(HttpRequestHandlingMessagingGateway.java:95)
    org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

org.springframework.integration.transformer.MessageTransformationException: failed to transform message
    org.springframework.integration.transformer.AbstractTransformer.transform(AbstractTransformer.java:44)
    org.springframework.integration.transformer.MessageTransformingHandler.handleRequestMessage(MessageTransformingHandler.java:67)
    org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:97)
    org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73)
    org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:114)
    org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:101)
    org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
    org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
    org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
    org.springframework.integration.core.MessagingTemplate.doSendAndReceive(MessagingTemplate.java:318)
    org.springframework.integration.core.MessagingTemplate.sendAndReceive(MessagingTemplate.java:239)
    org.springframework.integration.gateway.MessagingGatewaySupport.doSendAndReceive(MessagingGatewaySupport.java:233)
    org.springframework.integration.gateway.MessagingGatewaySupport.sendAndReceiveMessage(MessagingGatewaySupport.java:207)
    org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport.doHandleRequest(HttpRequestHandlingEndpointSupport.java:378)
    org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway.handleRequest(HttpRequestHandlingMessagingGateway.java:95)
    org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

java.lang.ClassCastException: [B cannot be cast to java.lang.String
    org.springframework.integration.json.JsonToObjectTransformer.transformPayload(JsonToObjectTransformer.java:30)
    org.springframework.integration.transformer.AbstractPayloadTransformer.doTransform(AbstractPayloadTransformer.java:33)
    org.springframework.integration.transformer.AbstractTransformer.transform(AbstractTransformer.java:33)
    org.springframework.integration.transformer.MessageTransformingHandler.handleRequestMessage(MessageTransformingHandler.java:67)
    org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:97)
    org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73)
    org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:114)
    org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:101)
    org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
    org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
    org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
    org.springframework.integration.core.MessagingTemplate.doSendAndReceive(MessagingTemplate.java:318)
    org.springframework.integration.core.MessagingTemplate.sendAndReceive(MessagingTemplate.java:239)
    org.springframework.integration.gateway.MessagingGatewaySupport.doSendAndReceive(MessagingGatewaySupport.java:233)
    org.springframework.integration.gateway.MessagingGatewaySupport.sendAndReceiveMessage(MessagingGatewaySupport.java:207)
    org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport.doHandleRequest(HttpRequestHandlingEndpointSupport.java:378)
    org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway.handleRequest(HttpRequestHandlingMessagingGateway.java:95)
    org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Can anybody help me with figuring out what could possible be wrong ?

I have double checked the headers, hence i am sure that I it’s something with the configuration or Jackson’s support for unmarshalling to HashMap. Thanks for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:26:12+00:00Added an answer on May 30, 2026 at 6:26 pm

    As Biju mentioned the integration graph wasnt correct, but the error was thrown even before the message reached json-to-object-transformer. After fixing the integration graph correctly i still was getting this error. after searching in spring integration forum, i found that mentioning request-payload-type in the int-http:inbound-gateway gateway solved the problem.

    So the correct configuration is

        <int-http:inbound-gateway id="inboundGateway"
         request-channel="incoming" reply-channel="outgoing" 
         supported-methods="POST" reply-timeout="5000"
         path="/customer/isUserAvailable" request-payload-type="String" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to setup Spring using Hibernate and JPA, but when trying to persist
I am trying to setup an control server application with Spring-JPA back-end and Restful
I'm trying to setup a Spring 3 Web MVC project, using the @Controller, annotation-based
I am trying to setup Spring MVC 3.0 to support localization. The messages are
Trying to setup a CodeIgniter based project for local development (LAMP stack), and once
I'm in the process of trying to setup database user authentication with Spring 3.
I am trying to setup a simple restful web application, using tomcat 6.0.32, cxf
I'm trying to setup a TransactionManager in my Web Application (powered by Spring MVC
EDITED HEADER: more related with the actual problem I'm trying to setup spring security
I am trying to setup my application to use Spring and also an image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.