title: JAVA - SPRING - the request was rejected because no multipart boundary was found
body: <p>Please read after answer.</p>
  
  <p>I have a project that is separate in two modules, one for "SERVICE" and one for "WEB"</p>
  
  <p>Service module works like a REST server and WEB module works like REST client to consume web services from Service module and works like a REST Server to an Angular APP</p>
  
  <p>When i make the request directly to Service Module with Postman attaching a CSV File, works like a charm, but when i try doing the same action with the WEB Module it gets 500 Status Code, and Service module get the follow trace:</p>
  
  <p>SERVICE MODULE</p>
  
  <pre><code>2018/oct/12 23:31:55.922 [http-nio-4501-exec-7] ERROR [dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found] with root cause
  org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found
      at org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.&lt;init&gt;(FileUploadBase.java:831)
      at org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:256)
      at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:280)
      at org.apache.catalina.connector.Request.parseParts(Request.java:2884)
      at org.apache.catalina.connector.Request.parseParameters(Request.java:3232)
      at org.apache.catalina.connector.Request.getParameter(Request.java:1137)
      at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:381)
      at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:75)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
  </code></pre>
  
  <p>SERVICE MODULE CONTROLLER</p>
  
  <pre><code>    @Autowired
      UtilitarioServicio utilitarioServicio;
  
      @RequestMapping(path = "/uploadFile", method = RequestMethod.POST,
          consumes = "multipart/form-data")
      public String getUploadedFile(
          @RequestParam("file") MultipartFile file,
          @RequestParam("procesoId") Integer procesoId, 
          @RequestParam("fuenteId") Integer fuenteId) throws IOException {
  
          utilitarioServicio.getUploadedFile(file, fuenteId, procesoId);
  
          return "";
      }
  </code></pre>
  
  <p>WEB MODULE CONTROLLER</p>
  
  <pre><code>    @Autowired
      UtilitarioServicioProxy restProxy;
  
      @RequestMapping(path = "/uploadFile", method = RequestMethod.POST)
      public String getUploadedFile(
          @RequestParam("file") MultipartFile file,
          @RequestParam("fuenteId") Integer fuenteId,
          @RequestParam("procesoId") Integer procesoId) throws IOException {
  
          restProxy.getUploadedFile(file, fuenteId, procesoId);
  
          return "";
      }
  </code></pre>
  
  <p>Thanks in advance.</p>