`
smartan
  • 浏览: 183817 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

严重: 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 参考 宛星 博客 谢谢你!

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics