title: org.apache.catalina.connector.RequestFacade cannot be cast to org.springframework.web.multipart.MultipartHttpServletRequest
body: <p>I have a web app with such config. Please look at multipartResolver bean. </p>
  
  <pre><code>@Configuration
  @EnableWebMvc
  @ComponentScan(basePackages = "com.websystique.springmvc")
  public class HelloWorldConfiguration extends WebMvcConfigurerAdapter{
  
      @Override
      public void configureViewResolvers(ViewResolverRegistry registry) {
          InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
          viewResolver.setViewClass(JstlView.class);
          viewResolver.setPrefix("/WEB-INF/views/");
          viewResolver.setSuffix(".jsp");
          registry.viewResolver(viewResolver);
      }
  
      @Override
      public void addResourceHandlers(ResourceHandlerRegistry registry) {
          registry.addResourceHandler("/static/**").addResourceLocations("/static/");
      }
  
  
      @Bean(name = "multipartResolver")
      public CommonsMultipartResolver multipartResolver() {
  
          final CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
          multipartResolver.setMaxUploadSize(100000);
  
          return multipartResolver;
      }
  }
  </code></pre>
  
  <p>also I have controller, which should accept file from client</p>
  
  <pre><code> @RequestMapping(value = "/file/", method = RequestMethod.POST)
      public ResponseEntity&lt;Void&gt; createUser(HttpServletRequest request) throws IOException {
  
          System.out.println("!!!");
          MultipartHttpServletRequest mRequest =
                  (MultipartHttpServletRequest) request; // Exception is here
          //some code
      }
  </code></pre>
  
  <p>I send file in this jsp snippet</p>
  
  <pre><code>&lt;input type="file" id="file" name="file" accept=".xls,.xlsx" enctype="multipart/form-data" /&gt;
            &lt;button ng-click="ctrl.add()"&gt;Add&lt;/button&gt;
  </code></pre>
  
  <p>by this angular code </p>
  
  <pre><code>function functionAdd() {
          var f = document.getElementById('file').files[0];
          var fd = new FormData();
  
          fd.append("file", f);
          return $http.post(REST_SERVICE_URI1, fd);
      }
  </code></pre>
  
  <p>I've got this stacktrace.  </p>
  
  <pre><code>java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens
      at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:410)
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:383)
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376)
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:748)
  </code></pre>
  
  <p>Maybe somebody can see a mistake.</p>