struts2 java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUti

今天想学下struts2,按照教程写了一个小的登录程序,启动tomcat总是报错

错误信息如下

严重: Exception starting filter struts2
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:209)
 at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:210)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)
 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.(ApplicationFilterConfig.java:103)
 at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
 at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:662)
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

 

我使用的struts2.3.4

在百度上搜了下,应该是缺少jar包

commons-lang3-3.1.jar

commons-lang-2.4.jar

这两个包加哪个都还是报错

后来一起加就好了。

 

最后的jar包目录

你可能感兴趣的:(struts2)