原文地址: http://www.cnblogs.com/dongritengfei/archive/2009/12/08/1619030.html
报错如下:
严重: Exception starting filter struts2
Unable to load configuration. - action - file:/D:/workspace/Ecplipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/GoogleMapFWZJW/WEB-INF/classes/struts.xml:7:38
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
。。。。。。。
Caused by: Action class [login] not found - action - file:/D:/workspace/Ecplipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/GoogleMapFWZJW/WEB-INF/classes/struts.xml:7:38
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:405)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:355)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:460)
。。。。。。。
对应的struts.xml文件如下:
<struts>
<package name="example" namespace="" extends="struts-default">
<action name="Login" class="login">
<result>/loginResult.jsp</result>
<result name="input">/login.jsp</result>
</action>
</package>
</struts>
其中的class=“login”的login对应spring的applicationContext.xml里的id为login的bean。
如果你的struts.xml和applicationContext.xml都配置正确,还报以上的错误,那么可以判断你的项目缺少jar包:struts2-spring-plugin-2.0.11.1.jar、commons-fileupload-1.2.1.jar和commons-io-1.3.2.jar
导入这些jar包就行了,这些jar可以在struts-2.1.6的lib下找到。
本文解决在使用Struts2框架时遇到的启动报错问题,包括Action类未找到错误,并提供了解决方案及所需导入的jar包。通过检查struts.xml配置文件与Spring的applicationContext.xml文件,确保项目的正确性。若错误仍然存在,可能是因为缺少关键的jar包,如struts2-spring-plugin-2.0.11.1.jar、commons-fileupload-1.2.1.jar和commons-io-1.3.2.jar。本文详细解释了如何定位问题并解决。
1万+

被折叠的 条评论
为什么被折叠?



