IT开发知识库 - 立志做成最实用的开发手册!

http://www.ipexe.com

当前位置: 开发知识库 > 应用服务器 > Apache > spring错误记录-java.lang.NoClassDefFoundError: org/apache

spring错误记录-java.lang.NoClassDefFoundError: org/apache

时间:2014-07-01来源: 作者:点击:
spring异常记录-----java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils今天在练习如何SSH中进行单元测试的时候出现下列异常: SEVERE: Exception starting fi
spring异常记录-----java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

今天在练习如何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以上版本即可.



顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
相关内容
推荐内容