码迷,mamicode.com
首页 > 编程语言 > 详细

spring异常记录-----java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

时间:2014-06-27 08:06:35      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:style   class   blog   code   java   tar   

今天在练习如何SSH中进行单元测试的时候出现下列异常:


SEVERE: Exception starting filter Struts2
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:211)
	at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:226)
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:473)
	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4638)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
	... 22 more

核心错误原因:java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils,很明显,是没有找到,org/apache/commons/lang3/StringUtils这个类,我查看了一下引入的包,果然,我导入的是2.4版本的,而项目是需要3,我换了个3.3版本的,立即就跑起来了.

解决方法:删除引入的低版本,换个3以上版本即可.



spring异常记录-----java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils,布布扣,bubuko.com

spring异常记录-----java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

标签:style   class   blog   code   java   tar   

原文地址:http://blog.csdn.net/u012332735/article/details/34995207

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!