Apache commons StringUtils 在运行时出现NoClassDefError错误的解决方法

Apache commons StringUtils 在运行时出现NoClassDefError错误的解决方法

在用tomcat运行WEB项目,并且使用了StringUtils包的时候,会出现
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
的错误

解决方案:

首先,去tomcat的webapp目录下,查看有没有我们引入的jar包,如果未发现,执行如下操作 
1、打开项目属性(Properties)
2、在左侧选择 deployment assembly
3、点击Add按钮
4、在打开的新界面中选择 Java Build Entries,点击 next,并选择出现的 jar 包,然后点击finish
5、返回上一个界面后点击 Apply and Close
这时重新运行项目就可以了。

图示:

猜你喜欢

转载自www.cnblogs.com/molisiye/p/9158436.html
今日推荐