No action instance for path /* could be created(
2010-07-13 08:42
429 查看
很久没有使用struts了.今天调试一个struts项目的时候,就碰到一个这样的错误:
HTTP Status 500 - No action instance for path /* could be created
真让我很郁闷了半天.这个错误意思是:请求所对应的action的实例无法创建。
以下是我的排错步骤:
1)检查一下配置文件struts-config的问题
例如,某一个action在struts-config.xml的配置如下:
<action
parameter="method"
scope="request"
path="/userAction"
name="userForm"
type="test.struts.action.UserAction"
validate="false">
<forward name="manageplugins" path="/admin/page/pluginsconfig/pluginsconfig.jsp" />
</action>
检查一下struts-config.xml中action元素属性type 的值与对应的action 类是名称是否一致,路径是否一致
2)检查编写的Action类是否继承struts的基类Action, DispatchAction, LookupDispatchAction
如果没有继承struts的基类或者继承错了,例如:
public class dispatchAction {
public ActionForward search(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
UserForm userForm = (UserForm) form;
String userName = userForm.getUserName();
//String password = userForm.getPassword();
if ("".equals(userName) || userName == null) {
return mapping.findForward("failure");
} else {
return mapping.findForward("success");
}
}
也会报这样的错误
3)版本问题
在开发环境中使用的是struts的高版本,在运行环境中使用的是struts的低版本.
如在开发环境中,使用struts1.1以上版本,编写的Action类继承struts的基类DispatchAction.
但在运行环境中部署的是struts低版本的jar包,也会报这样的错误.
这种情况就是很多人说的在一台电脑上运行没问题,但换成了另一台电脑就出问题了.
HTTP Status 500 - No action instance for path /* could be created
真让我很郁闷了半天.这个错误意思是:请求所对应的action的实例无法创建。
以下是我的排错步骤:
1)检查一下配置文件struts-config的问题
例如,某一个action在struts-config.xml的配置如下:
<action
parameter="method"
scope="request"
path="/userAction"
name="userForm"
type="test.struts.action.UserAction"
validate="false">
<forward name="manageplugins" path="/admin/page/pluginsconfig/pluginsconfig.jsp" />
</action>
检查一下struts-config.xml中action元素属性type 的值与对应的action 类是名称是否一致,路径是否一致
2)检查编写的Action类是否继承struts的基类Action, DispatchAction, LookupDispatchAction
如果没有继承struts的基类或者继承错了,例如:
public class dispatchAction {
public ActionForward search(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
UserForm userForm = (UserForm) form;
String userName = userForm.getUserName();
//String password = userForm.getPassword();
if ("".equals(userName) || userName == null) {
return mapping.findForward("failure");
} else {
return mapping.findForward("success");
}
}
也会报这样的错误
3)版本问题
在开发环境中使用的是struts的高版本,在运行环境中使用的是struts的低版本.
如在开发环境中,使用struts1.1以上版本,编写的Action类继承struts的基类DispatchAction.
但在运行环境中部署的是struts低版本的jar包,也会报这样的错误.
这种情况就是很多人说的在一台电脑上运行没问题,但换成了另一台电脑就出问题了.
相关文章推荐
- HTTP Status 500 - No action instance for path could be created
- The server encountered an internal error (No action instance for path /user could be created) th...
- No action instance for path /serviceAgency could be created
- The server encountered an internal error (No action instance for path /user could be created) that prevented it from fulfilling
- HTTP Status 500 - No action instance for path /store could be created
- HTTP Status 500 - No action instance for path /student could be created
- 错误:No action instance for path /login could be created
- No action instance for path /* could be created
- Struts中关于"No action instance for path XXX could be created"的问题
- No action instance for path /leftTreeMenu could be created
- No actino instance for path /user could be created
- 完美解决HTTP Status 500 - No action instance could be created的问题
- log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlA
- log4j:WARN No appenders could be found for logger
- log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.TldConfig).
- log4j:WARN No appenders could be found for logger
- Error Log: type parameters of <T>T cannot be determined; no unique maximal instance exists for ...
- Silverlight + WCF + EF4 调用出错,Server 端的Exception:The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
- There is no Action mapped for namespace [/] and action name [Login] associated with context path [/e
- tomcat启动的时候报“warn no appenders could be found for logger ...."错的原因