I am trying to use the commons-fileupload module, including its dependency in pom.xml. However, when loading, there is no problem starting the web application, this causes the "NoClassDefFound" error:
java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory
Here is my pom.xml config:
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>
In addition, I have included the following configuration in applicationContext.xml:
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
I wonder what I'm doing wrong here?
source
share