严重: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/apac

[code="java"]严重: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:198) at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:180) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424) at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:273) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:98) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4584) at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5262) at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5257) 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:619) Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 20 more [/code] [size=medium] 正在学习struts 2.0,遇到个启动Tomcat的错误。

错误类型是: 严重: Exception starting filter struts2java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils

 我使用的struts 2.0的框架版本是:2.2.3,按照风中叶 老师的示例(引用的是struts 2.1.6)只引用6个jar包。

根据错误类型,明显是类无法找到,也就是需要的jar包没引用 可以解决问题,引用jar包如图所示:

解决方案是导入:commons-lang- 2.5.jar 参考 宛星 博客 谢谢你!

转载于:https://my.oschina.net/u/737187/blog/309638

发布了152 篇原创文章 · 获赞 47 · 访问量 28万+
展开阅读全文
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览