HTTP Status 500 - Unable to instantiate Action, customerAction, defined for 'customer_toAddPage' i
使用struts2时碰到这样的错误
HTTP Status 500 - Unable to instantiate Action, customerAction, defined for 'customer_toAddPage' in namespace '/'Error creating bean with name 'customerAction' defined in class path resource [customer.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'userService' of bean class [cn.itcast.action.CustomerAction]: Bean property 'userService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
type Exception report message Unable to instantiate Action, customerAction, defined for 'customer_toAddPage' in namespace '/'Error creating bean with name 'customerAction' defined in class path resource [customer.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'userService' of bean class [cn.itcast.action.CustomerAction]: Bean property 'userService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? description The server encountered an internal error that prevented it from fulfilling this request. exception Unable to instantiate Action, customerAction, defined for 'customer_toAddPage' in namespace '/'Error creating bean with name 'customerAction' defined in class path resource [customer.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'userService' of bean class [cn.itcast.action.CustomerAction]: Bean property 'userService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? - action - file:/D:/install/myeclipse2017/workspace/.metadata/.me_tcat85/webapps/ssh_crm02/WEB-INF/classes/struts.xml:14:65
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:314)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:395)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:37)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:554)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
root cause org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerAction' defined in class path resource [customer.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'userService' of bean class [cn.itcast.action.CustomerAction]: Bean property 'userService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1518)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:325)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1054)
com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:161)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:178)
com.opensymphony.xwork2.factory.DefaultActionFactory.buildAction(DefaultActionFactory.java:22)
com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:148)
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:295)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:395)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:37)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:554)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
root cause org.springframework.beans.NotWritablePropertyException: Invalid property 'userService' of bean class [cn.itcast.action.CustomerAction]: Bean property 'userService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.BeanWrapperImpl.createNotWritablePropertyException(BeanWrapperImpl.java:231)
org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:423)
org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:280)
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95)
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1514)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:325)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1054)
com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:161)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:178)
com.opensymphony.xwork2.factory.DefaultActionFactory.buildAction(DefaultActionFactory.java:22)
com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:148)
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:295)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:395)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:37)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:554)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
note The full stack trace of the root cause is available in the Apache Tomcat/8.5.9 logs.
原因就是spring的配置文件中的bean写错了,经过了仔细检查发现是property和类中属性不一样的情况。
HTTP Status 500 - Unable to instantiate Action, customerAction, defined for 'customer_toAddPage' i的更多相关文章
- 报错HTTP Status 500 - Unable to instantiate Action
报错如下: HTTP Status 500 - Unable to instantiate Action, visitAction, defined for 'visit_toAddPage' in ...
- spring与struts2整合出现错误HTTP Status 500 - Unable to instantiate Action
在进行spring和struts2整合的时候因为大意遇到了一个问题,费了半天神终于找到了问题所在,故分享出来望广大博友引以为戒!! 我们都知道在spring和struts2整合时,spring接管了a ...
- SSH Spring3\Java1.8 “Unable to instantiate Action, xxAction, defined for 'xxAction_login' in namespace '/'null”
1.Stacktraces Unable to instantiate Action,xxAction, defined for 'xxAction_login' in namespace '/'nu ...
- Unable to instantiate Action, xxxAction, defined for 'xxxAction' in namespace '/'xxx
最近写SSH2的项目时,遇到一些小问题,action得不到service实例,遂将struct2委托给spring进行管理,然后修改了bean的id和action的class,但是运行后发现找不到ac ...
- SSH整合:Unable to instantiate Action, employeeAction, defined for 'emp-list' in namespace '/'employeeAction - action
SSH整合,照着视频敲的,不知为何会报错,经历了快两周的折磨给解决了.记录下来给后面需要帮助的人,也算极好的了. Struts Problem Report Struts has detected a ...
- SSH整合报错:Unable to instantiate Action, testAction, defined for 'test' in namespace '/'testAction
报错如下: Struts Problem Report Struts has detected an unhandled exception: Messages: testAction Unable ...
- 出现"Unable to instantiate Action,xxxxx, defined for 'login' in namespace '/' xxxxx 解决办法
转自:https://blog.csdn.net/heroful/article/details/17261169 问题原因: 在MyEclipse 利用SSH框架写程序,运行时出现 " U ...
- 2.Unable to instantiate Action, templateAction, defined for 'template_list' in namespace '/'templateAction
1.错误说没有命名空间'templateAction,但是在struts里写了这个,名字跟Action的名字是一样的,为什么会报这个错误 2.反复检查路径和名字,都没有问题 3.发现没有对其进行注入操 ...
- Unable to instantiate Action, xxxAction, defined for 'xxx' in namespace '/'xxxAction解决方式
出现这个问题的解决办法主要有两个 1.假设项目没有使用Spring,则struts.xml配置文件里,这个action的class属性的路径没有写完整,应该是包名.类名 2.假设项目使用了Spring ...
随机推荐
- Redisson教程
Redisson入门 Author:Ricky Date:2017-04-24 Redisson概述 Redisson是架设在Redis基础上的一个Java驻内存数据网格(In-Memory Dat ...
- 巨蟒python全栈开发数据库前端5:JavaScript1
1.js介绍&变量&基础数据类型 2.类型查询&运算符&if判断&for循环 3.while循环&三元运算符 4.函数 5.今日总结 1.js介绍&am ...
- tortoisegit错误: disconnected - no supported authentication methods available(server sent: publickey)
修改小乌龟的 SSH客户端:
- python scrapy,beautifulsoup,regex,sgmparser,request,connection
In [2]: import requests In [3]: s = requests.Session() In [4]: s.headers 如果你是爬虫相关的业务?抓取的网站还各种各样, ...
- Windows Server 2012 云硬盘如何挂载
那么首先科普一下,云服务器的数据盘(也就是我们买的云硬盘)默认是脱机状态,不自动挂载的.下面来教大家win2012环境如何挂载硬盘,其实和03.08的大同小异就是入口不同了. 点击“工具”中的“计 ...
- zookeer安装
解压:tar xf zookeeper-3.4.9.tar.gz进入目录cd /opt/zookeeper-3.4.9/ 编辑配置文件:vim zoo.cfg# The number of milli ...
- 吴超老师课程--Flume的安装和介绍
常用的分布式日志收集系统
- python全栈开发从入门到放弃之元组的内置应用
1.元组的字符类型tuple t=(1,[1,3],'sss',(1,2)) print(type(t)) <class 'tuple'> 2.按索引号取值 t=(1,[1,3],'sss ...
- Python之验证码
Python生成随机验证码,需要使用PIL模块. 安装: ? 1 pip3 install pillow 基本使用 1. 创建图片 ? 1 2 3 4 5 6 7 8 9 from PIL impor ...
- Java设计模式学习之工厂模式
在Java(或者叫做面向对象语言)的世界中,工厂模式被广泛应用于项目中,也许你并没有听说过,不过也许你已经在使用了.Java 设计模式之工厂模式 简单来说,工厂模式的出现源于增加程序序的可扩展性,降低 ...