首页 > 编程语言 > 详细

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

时间:2014-08-11 23:45:33      阅读:577      评论:0      收藏:0      [点我收藏+]

今天在练习怎样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

原文:http://www.cnblogs.com/mengfanrong/p/3905625.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!