title: Fail to configure CommonsMultipartResolver in Spring4
body: <p>I configure CommonsMultipartResolver in applicationContext.xml like following:</p>
  
  <pre><code>&lt;bean id="multipartResolver"
        class="org.springframework.web.multipart.commons.CommonsMultipartResolver"&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>but it throws exception as following:</p>
  
  <pre><code>15-Feb-2017 22:17:35.049 INFO [RMI TCP Connection(2)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
  15-Feb-2017 22:17:35.107 INFO [RMI TCP Connection(2)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization started
  15-Feb-2017 22:17:35.172 INFO [RMI TCP Connection(2)-127.0.0.1] org.springframework.web.context.support.XmlWebApplicationContext.prepareRefresh Refreshing Root WebApplicationContext: startup date [Wed Feb 15 22:17:35 CST 2017]; root of context hierarchy
  15-Feb-2017 22:17:35.240 INFO [RMI TCP Connection(2)-127.0.0.1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
  15-Feb-2017 22:17:35.563 WARNING [RMI TCP Connection(2)-127.0.0.1] org.springframework.web.context.support.XmlWebApplicationContext.refresh Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'multipartResolver' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.multipart.commons.CommonsMultipartResolver]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory
  15-Feb-2017 22:17:35.575 SEVERE [RMI TCP Connection(2)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Context initialization failed
   org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'multipartResolver' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.multipart.commons.CommonsMultipartResolver]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1155)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
      ...
  </code></pre>
  
  <p>I don't known why CommonsMultipartResolver failed to be instantiated. I can find CommonsMultipartResolver in spring-web-4.3.6.RELEASE.jar.
  But this exception is thrown:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory
  </code></pre>
  
  <p>What's wrong with my configuration?(I'm using Intellij IDEA)<br>
  <BR>
  <strong>UPDATE</strong><br>
  this is my applicationContext.xml</p>
  
  
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"&gt;
      &lt;bean id="multipartResolver"
            class="org.springframework.web.multipart.commons.CommonsMultipartResolver"&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>I have tried to solve the problem by adding <code>commons-fileupload</code> to IDEA project settings --> libraries. But it does't help, problems still.<br>
  <a href="https://i.stack.imgur.com/Yiilf.png" rel="noreferrer">project structure setting of IDEA</a></p>
  
  <p><a href="https://i.stack.imgur.com/8AANU.png" rel="noreferrer">project structure setting of IDEA</a></p>