exception启动filterstruts2无法加载配置。 – 豆

嗨,我是Struts的新手,并试图用struts打招呼,但我得到了错误。 我试图解决它但无法做到。 错误消息是

EVERE: Exception starting filter struts2 Unable to load configuration. - bean - jar:file:/home/sudarshan/Desktop/RestFullTuts/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts2starter/WEB-INF/lib/struts2-portlet-plugin-2.3.28.jar!/struts-plugin.xml:31:133 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:496) at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4574) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5193) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: Unable to load configuration. - bean - jar:file:/home/sudarshan/Desktop/RestFullTuts/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts2starter/WEB-INF/lib/struts2-portlet-plugin-2.3.28.jar!/struts-plugin.xml:31:133 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70) at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:970) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:438) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:482) ... 14 more 

我的struts.xml文件是

     success.jsp error.jsp    

Web.xml是

   struts2starter  index.html index.htm index.jsp default.html default.htm default.jsp   struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter    struts2 /*   

那么这段代码的解决方案是什么呢?

从类路径中删除struts2-portlet-plugin-2.3.28.jar 。 但是对于管理库的解决方案,您可以使用Maven。

请参阅使用Maven构建的教程:使用Maven 创建Struts 2 Web应用程序以管理工件和构建应用程序 。

下载的最小依赖项

  org.apache.struts struts2-core 2.3.28