HTTP Status 500 -Unable to instantiate Action....
2017-10-31 21:28
501 查看
关于无法出示Action的错误(错误提示如下):
HTTP Status 500 -Unable to instantiate Action,
com.demo.registeration.action.UserAction,
defined for 'user' in namespace '/'Failed to convert property value of type [com.demo.registeration.action.UserAction]
to required type [com.demo.registeration.model.User] for property 'u';
nested exception is java.lang.IllegalArgumentException:
Cannot convert value of type [com.demo.registeration.action.UserAction] to required type
[com.demo.registeration.model.User] for property 'u': no matching editors or conversion strategy found
struts2-spring-plugin插件在产生action的时候,会自动把action的属性注入进来,默认按照名字注入。
当action启动后,会自动将里面的属性(提供set方法的属性)自动装载(不写@Resource的也装载,就是@Resource可以不写了),
由于action已经交给了spring容器来管理,如下action的默认名字就是userAction。而此时,如果你的Action中刚好有一个
引用的名字也叫userAction,就可能引起上面的bug
@Component
public class UserAction extends ActionSupport implements ModelDriven{......}
HTTP Status 500 -Unable to instantiate Action,
com.demo.registeration.action.UserAction,
defined for 'user' in namespace '/'Failed to convert property value of type [com.demo.registeration.action.UserAction]
to required type [com.demo.registeration.model.User] for property 'u';
nested exception is java.lang.IllegalArgumentException:
Cannot convert value of type [com.demo.registeration.action.UserAction] to required type
[com.demo.registeration.model.User] for property 'u': no matching editors or conversion strategy found
struts2-spring-plugin插件在产生action的时候,会自动把action的属性注入进来,默认按照名字注入。
当action启动后,会自动将里面的属性(提供set方法的属性)自动装载(不写@Resource的也装载,就是@Resource可以不写了),
由于action已经交给了spring容器来管理,如下action的默认名字就是userAction。而此时,如果你的Action中刚好有一个
引用的名字也叫userAction,就可能引起上面的bug
@Component
public class UserAction extends ActionSupport implements ModelDriven{......}
相关文章推荐
- 升级struts2.3.24 HTTP Status 500 - Unable to instantiate Action
- HTTP Status 500 - Unable to instantiate Action
- HTTP Status 500 - Unable to instantiate Action, customerAction, defined for 'CustomerAction_list' in
- eclipse运行ssh项目出现"HTTP Status 500 - Unable to instantiate Action"
- HTTP Status 500 - Unable to instantiate Action, AccountAction, defined for 'accountindex' in namespa
- ssh整合错误:HTTP Status 500 - Unable to instantiate Action, empaction
- eclipse运行ssh项目出现"HTTP Status 500 - Unable to instantiate Action"
- HTTP Status 500 - Unable to compile class for JSP
- jsp调用javabean出现错误HTTP Status 500 - Unable to compile class for JSP
- HTTP Status 500 - Unable to compile class for JSP:
- ssh报 HTTP Status 500 - Unable to instantiate Action, com.web.action.UserAction, defined for 'login'
- HTTP Status 500 - Unable to show problem report: freemarker.template.TemplateModelException: Method
- HTTP Status 500 - Unable to compile class for JSP:Syntax error on token "=", @ expected
- HTTP Status 500 - Unable to create directory
- HTTP Status 500 - Unable to compile class for JSP问题小结(解决)
- 问题之HTTP Status 500 - Unable to compile class for JSP更优雅的解决方案
- HTTP Status 500 - Unable to compile class for JSP
- maven用框架编写网页运行出现HTTP Status 500 - Unable to compile class for JSP
- HTTP Status 500 - Unable to compile class for JSP
- HTTP Status 500 - Unable to compile class for JSP:Duplicate local variable xxx