title: How to pass HttpServletRequest using RestTemplate (POST)
body: <p>i am trying to call service B from service A</p>
  
  <p>Service A:</p>
  
  <pre><code>@RequestMapping(value = { ""getCustomer"}, method = RequestMethod.POST)
  public @ResponseBody ResponseEntity&lt;Object&gt; webApiQueryByPost(HttpServletRequest request)
          throws JsonParseException, JsonMappingException, IOException {
      Map&lt;String, String[]&gt; email = request.getParameterMap();
      RestTemplate rest = new RestTemplate();
  
      Object response = rest.postForObject("http://localhost:8084/getCustomer", request, Object.class, email);
          return new ResponseEntity&lt;&gt;(response,HttpStatus.OK);
  
  }
  </code></pre>
  
  <p>Service B:</p>
  
  <pre><code>    @RequestMapping(value = "getCustomer", method = RequestMethod.POST)
  public ResponseEntity&lt;Object&gt; getWebCustomer(@RequestParam String email,
          HttpServletRequest request) {   
          return webCustomerDataService.getCustomerData(email);
  }
  </code></pre>
  
  <p>Service A needs to pass the request to Service B. </p>
  
  <p>Exception :</p>
  
  <blockquote>
  <pre><code>&gt; org.springframework.http.converter.HttpMessageNotWritableException:
  &gt; Could not write content: not in non blocking mode. (through reference
  &gt; chain:
  &gt; org.apache.catalina.connector.RequestFacade["inputStream"]-&gt;org.apache.catalina.connector.CoyoteInputStream["ready"]);
  &gt; nested exception is
  &gt; com.fasterxml.jackson.databind.JsonMappingException: not in non
  &gt; blocking mode. (through reference chain:
  &gt; org.apache.catalina.connector.RequestFacade["inputStream"]-&gt;org.apache.catalina.connector.CoyoteInputStream["ready"])
  &gt;     at
  &gt; org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:238)
  &gt;     at
  &gt; org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:208)
  &gt;     at
  &gt; org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:774)
  &gt;     at
  &gt; org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:567)
  &gt;     at
  &gt; org.springframework.web.client.RestTemplate.execute(RestTemplate.java:538)
  &gt;     at
  &gt; org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:340)
  &gt;     at
  &gt; com.xx.yy.zz.controller.MainController.webApiQueryByPost(MainController.java:78)
  &gt;     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
  &gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  &gt;     at
  &gt; sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  &gt;     at java.lang.reflect.Method.invoke(Method.java:497)     at
  &gt; org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
  &gt;     at
  &gt; org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
  &gt;     at
  &gt; org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
  &gt;     at
  &gt; org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
  &gt;     at
  &gt; org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
  &gt;     at
  &gt; org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
  &gt;     at
  &gt; org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
  &gt;     at
  &gt; org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
  &gt;     at
  &gt; org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
  &gt;     at
  &gt; org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
  &gt;     at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)     at
  &gt; org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
  &gt;     at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; com.xx.xx.xx.filter.BlueBerryCORSFilter.doFilter(BlueBerryCORSFilter.java:54)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
  &gt;     at
  &gt; org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
  &gt;     at
  &gt; org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
  &gt;     at
  &gt; org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
  &gt;     at
  &gt; org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
  &gt;     at
  &gt; org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
  &gt;     at
  &gt; org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
  &gt;     at
  &gt; org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
  &gt;     at
  &gt; org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
  &gt;     at
  &gt; org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
  &gt;     at
  &gt; org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
  &gt;     at
  &gt; org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521)
  &gt;     at
  &gt; org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478)
  &gt;     at
  &gt; java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  &gt;     at
  &gt; java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  &gt;     at
  &gt; org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  &gt;     at java.lang.Thread.run(Thread.java:745) Caused by:
  &gt; com.fasterxml.jackson.databind.JsonMappingException: not in non
  &gt; blocking mode. (through reference chain:
  &gt; org.apache.catalina.connector.RequestFacade["inputStream"]-&gt;org.apache.catalina.connector.CoyoteInputStream["ready"])
  &gt;     at
  &gt; com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:210)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:177)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:187)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:647)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:152)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:505)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:639)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:152)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:128)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:1902)
  &gt;     at
  &gt; org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:231)
  &gt;     ... 54 more Caused by: java.lang.IllegalStateException: not in non
  &gt; blocking mode.  at
  &gt; org.apache.catalina.connector.InputBuffer.isReady(InputBuffer.java:285)
  &gt;     at
  &gt; org.apache.catalina.connector.CoyoteInputStream.isReady(CoyoteInputStream.java:242)
  &gt;     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
  &gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  &gt;     at
  &gt; sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  &gt;     at java.lang.reflect.Method.invoke(Method.java:497)     at
  &gt; com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:466)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:639)
  &gt;     ... 61 more
  &gt; org.springframework.http.converter.HttpMessageNotWritableException:
  &gt; Could not write content: not in non blocking mode. (through reference
  &gt; chain:
  &gt; org.apache.catalina.connector.RequestFacade["inputStream"]-&gt;org.apache.catalina.connector.CoyoteInputStream["ready"]);
  &gt; nested exception is
  &gt; com.fasterxml.jackson.databind.JsonMappingException: not in non
  &gt; blocking mode. (through reference chain:
  &gt; org.apache.catalina.connector.RequestFacade["inputStream"]-&gt;org.apache.catalina.connector.CoyoteInputStream["ready"])
  &gt;     at
  &gt; org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:238)
  &gt;     at
  &gt; org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:208)
  &gt;     at
  &gt; org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:774)
  &gt;     at
  &gt; org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:567)
  &gt;     at
  &gt; org.springframework.web.client.RestTemplate.execute(RestTemplate.java:538)
  &gt;     at
  &gt; org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:340)
  &gt;     at
  &gt; com.xx.yy.zz.controller.MainController.webApiQueryByPost(MainController.java:78)
  &gt;     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
  &gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  &gt;     at
  &gt; sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  &gt;     at java.lang.reflect.Method.invoke(Method.java:497)     at
  &gt; org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
  &gt;     at
  &gt; org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
  &gt;     at
  &gt; org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
  &gt;     at
  &gt; org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
  &gt;     at
  &gt; org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
  &gt;     at
  &gt; org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
  &gt;     at
  &gt; org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
  &gt;     at
  &gt; org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
  &gt;     at
  &gt; org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
  &gt;     at
  &gt; org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
  &gt;     at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)     at
  &gt; org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
  &gt;     at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; com.xx.yy.zz.filter.BlueBerryCORSFilter.doFilter(BlueBerryCORSFilter.java:54)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
  &gt;     at
  &gt; org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
  &gt;     at
  &gt; org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
  &gt;     at
  &gt; org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
  &gt;     at
  &gt; org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
  &gt;     at
  &gt; org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
  &gt;     at
  &gt; org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
  &gt;     at
  &gt; org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
  &gt;     at
  &gt; org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
  &gt;     at
  &gt; org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
  &gt;     at
  &gt; org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
  &gt;     at
  &gt; org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521)
  &gt;     at
  &gt; org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478)
  &gt;     at
  &gt; java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  &gt;     at
  &gt; java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  &gt;     at
  &gt; org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  &gt;     at java.lang.Thread.run(Thread.java:745) Caused by:
  &gt; com.fasterxml.jackson.databind.JsonMappingException: not in non
  &gt; blocking mode. (through reference chain:
  &gt; org.apache.catalina.connector.RequestFacade["inputStream"]-&gt;org.apache.catalina.connector.CoyoteInputStream["ready"])
  &gt;     at
  &gt; com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:210)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:177)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:187)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:647)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:152)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:505)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:639)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:152)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:128)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:1902)
  &gt;     at
  &gt; org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:231)
  &gt;     ... 54 more Caused by: java.lang.IllegalStateException: not in non
  &gt; blocking mode.  at
  &gt; org.apache.catalina.connector.InputBuffer.isReady(InputBuffer.java:285)
  &gt;     at
  &gt; org.apache.catalina.connector.CoyoteInputStream.isReady(CoyoteInputStream.java:242)
  &gt;     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
  &gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  &gt;     at
  &gt; sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  &gt;     at java.lang.reflect.Method.invoke(Method.java:497)     at
  &gt; com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:466)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:639)
  &gt;     ... 61 more
  &gt; org.springframework.http.converter.HttpMessageNotWritableException:
  &gt; Could not write content: not in non blocking mode. (through reference
  &gt; chain:
  &gt; org.apache.catalina.connector.RequestFacade["inputStream"]-&gt;org.apache.catalina.connector.CoyoteInputStream["ready"]);
  &gt; nested exception is
  &gt; com.fasterxml.jackson.databind.JsonMappingException: not in non
  &gt; blocking mode. (through reference chain:
  &gt; org.apache.catalina.connector.RequestFacade["inputStream"]-&gt;org.apache.catalina.connector.CoyoteInputStream["ready"])
  &gt;     at
  &gt; org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:238)
  &gt;     at
  &gt; org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:208)
  &gt;     at
  &gt; org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:774)
  &gt;     at
  &gt; org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:567)
  &gt;     at
  &gt; org.springframework.web.client.RestTemplate.execute(RestTemplate.java:538)
  &gt;     at
  &gt; org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:340)
  &gt;     at
  &gt; com.xx.yy.zz.controller.MainController.webApiQueryByPost(MainController.java:78)
  &gt;     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
  &gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  &gt;     at
  &gt; sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  &gt;     at java.lang.reflect.Method.invoke(Method.java:497)     at
  &gt; org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
  &gt;     at
  &gt; org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
  &gt;     at
  &gt; org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
  &gt;     at
  &gt; org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
  &gt;     at
  &gt; org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
  &gt;     at
  &gt; org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
  &gt;     at
  &gt; org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
  &gt;     at
  &gt; org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
  &gt;     at
  &gt; org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
  &gt;     at
  &gt; org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
  &gt;     at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)     at
  &gt; org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
  &gt;     at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; com.xx.yy.gateway.filter.BlueBerryCORSFilter.doFilter(BlueBerryCORSFilter.java:54)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
  &gt;     at
  &gt; org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
  &gt;     at
  &gt; org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
  &gt;     at
  &gt; org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  &gt;     at
  &gt; org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
  &gt;     at
  &gt; org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
  &gt;     at
  &gt; org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
  &gt;     at
  &gt; org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
  &gt;     at
  &gt; org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
  &gt;     at
  &gt; org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
  &gt;     at
  &gt; org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
  &gt;     at
  &gt; org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
  &gt;     at
  &gt; org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
  &gt;     at
  &gt; org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521)
  &gt;     at
  &gt; org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478)
  &gt;     at
  &gt; java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  &gt;     at
  &gt; java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  &gt;     at
  &gt; org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  &gt;     at java.lang.Thread.run(Thread.java:745) Caused by:
  &gt; com.fasterxml.jackson.databind.JsonMappingException: not in non
  &gt; blocking mode. (through reference chain:
  &gt; org.apache.catalina.connector.RequestFacade["inputStream"]-&gt;org.apache.catalina.connector.CoyoteInputStream["ready"])
  &gt;     at
  &gt; com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:210)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:177)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:187)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:647)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:152)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:505)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:639)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:152)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:128)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:1902)
  &gt;     at
  &gt; org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:231)
  &gt;     ... 54 more Caused by: java.lang.IllegalStateException: not in non
  &gt; blocking mode.  at
  &gt; org.apache.catalina.connector.InputBuffer.isReady(InputBuffer.java:285)
  &gt;     at
  &gt; org.apache.catalina.connector.CoyoteInputStream.isReady(CoyoteInputStream.java:242)
  &gt;     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
  &gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  &gt;     at
  &gt; sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  &gt;     at java.lang.reflect.Method.invoke(Method.java:497)     at
  &gt; com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:466)
  &gt;     at
  &gt; com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:639)
  &gt;     ... 61 more
  </code></pre>
  </blockquote>
  
  <p>Motive of passing the whole Request is to make this method generic for different requests and it should only pass the request from Service A to Service B .</p>
  
  <p>Do we need to convert the request into Map(to extract request param's from HttpServletRequest)?</p>
  
  <p>Is there any way to pass the HttpServletRequest directly to Service B ?</p>
  
  <p>Please note: i tried different methods available in RestTemplate.</p>
  
  <p>Any help / Pointers would be appreciated.</p>
  
  <p>Thanks</p>