NoClassDefFoundError: org/apache/commons/io/FileUtils

在做Struts Demo中出现:

Exception starting filter struts2 java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils

通过查找发现需要在原来5个基础包(struts2-core-2.1.8.1.jar、xwork-core-2.1.6.jar、commons-logging-1.0.4.jar、freemarker-2.3.15.jar、ognl-2.7.3.jar)的基础上添加commons-io-2.0.1.jar、commons-lang-2.5.jar、javassist-3.11.0.GA.jar

加上之后,又会出现:

Caused by: java.lang.ClassNotFoundException: org.apache.commons.fileupload.RequestContext

此时需要加commons-fileupload-1.2.2.jar

相关推荐