getting error missing a runtime dependency: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItem

淺唱寂寞╮ 提交于 2019-11-28 14:11:48
Vipul

java doc says

NoClassDefFoundError Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.

The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found.

org.apache.commons.fileupload.FileItem is a class in FileUpload component of Apache Commons which is missing in your class path. Add following maven dependency for FileUpload component in your pom.xml.

 <dependency>   
    <groupId>commons-fileupload</groupId>
    <artifactId>commons-fileupload</artifactId>     
    <version>x.x</version>
 </dependency>

you can also check BalusC's this answer,

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!