Struts错误NoSuchMethodError: com.opensymphony.xwork2

严重: Exception starting filter struts2
java.lang.NoSuchMethodError: com.opensymphony.xwork2.util.finder.UrlSet.includeClassesUrl(Lcom/opensymphony/xwork2/util/finder/ClassLoaderInterface;)Lcom/opensymphony/xwork2/util/finder/UrlSet;
 at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildUrlSet(PackageBasedActionConfigBuilder.java:417)
 at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:376)
 at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:334)
 at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:260)
 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: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.<init>(ApplicationFilterConfig.java:98)
 at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4562)
 at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5240)
 at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5235)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
2013-8-1 16:22:34 org.apache.catalina.core.StandardContext startInternal

解决方法:

我使用的jar包:struts2-core-2.3.12.jar + struts2-convention-plugin-2.2.16.jar + xwork-core-2.3.12.jar。解决方法是把struts2-convention-plugin-2.2.16.jar换成struts2-convention-plugin-2.3.12.jar就可以。版本号要与struts-core、xwork-core版本号一致

你可能感兴趣的:(Struts错误NoSuchMethodError: com.opensymphony.xwork2)