项目中遇到 no matching editors or conversion strategy found
来源:互联网 发布:应届生java程序员面试 编辑:程序博客网 时间:2024/05/21 21:55
控制台报错:
Unable to instantiate Action, com.anyuan.erp.pa.leagueworking.onlinetrain.web.OnlineTrainAction, defined for 'frame' in namespace '/leagueworking/onlinetrain'Failed to convert property value of type [com.sun.proxy.$Proxy40] to required type [com.anyuan.erp.pa.leagueworking.onlinetrain.service.OnlineTrainService] for property 'onlineTrainService'; nested exception is java.lang.IllegalArgumentException:Cannot convert value of type [com.sun.proxy.$Proxy40] to required type [com.anyuan.erp.pa.leagueworking.onlinetrain.service.OnlineTrainService] for property 'onlineTrainService':no matching editors or conversion strategy found - action - file:/E:/workspace/AYERP_PA/target/classes/pa/struts/leagueworking/onlinetrain/struts-onlineTrain.xml:7:107
在做项目时自己的实现类OnlineTrainServiceImpl需要去继承框架里的一个抽象类,大意忘了去实现自己的接口OnlineTrainService,
等完成代码,Spring以及Struts配置文件后,去运行项目,结果页面报错。控制台出现了上面的一堆错误,起初我以为是配置文件里的action的namespace以及报名写错了,仔细对比发现没有什么问题,在网上搜,才发现报错的原因是没有实现类实现错了接口,或者没有实现接口,才会导致 嵌套异常为java.lang.IllegalArgumentException:无法将属性'onlineTrainService'的类型[com.sun.proxy。$ Proxy40]的值转换为必需类型[com.anyuan.erp.pa.leagueworking.onlinetrain.service.OnlineTrainService]: 找不到匹配的编辑器或转换策略 - action - file:/
Spring配置文件如下:
<!--在线培训记录-->
<bean id="onlineTrainService" class="com.anyuan.erp.pa.leagueworking.onlinetrain.service.impl.OnlineTrainServiceImpl" />
修改自己的实现类实现自己所写的interface之后,就不会报错了;
其原因我觉得可能是:
Spring注入的是接口,关联的是实现类。 这里注入了实现类,所以报异常了。正如我的配置文件bean id="onlineTrainService" 但是却关联的是实现类,而我的实现类有没有去实现自己的接口,所以才会报错。
- 项目中遇到 no matching editors or conversion strategy found
- no matching editors or conversion strategy found
- no matching editors or conversion strategy found
- no matching editors or conversion strategy found
- no matching editors or conversion strategy found
- no matching editors or conversion strategy found
- No Matching editors or conversion strategy found
- spring报no matching editors or conversion strategy found
- 解决: Spring no matching editors or conversion strategy found
- no matching editors or conversion strategy found 的解决办法
- no matching editors or conversion strategy found 异常
- no matching editors or conversion strategy found 异常_解决办法
- spring配置 no matching editors or conversion strategy found 异常解决方案
- spring配置 no matching editors or conversion strategy found 异常解决方案
- 自定义类型转换器出错:no matching editors or conversion strategy found
- spring java.lang.IllegalArgumentException:。。。 no matching editors or conversion strategy found异常
- Spring中的报错:no matching editors or conversion strategy found
- aop配置拦截器required type [***] for property 'myBean': no matching editors or conversion strategy found
- Apache mod_fcgid php缓冲区问题
- LeetCode之路—— Roman to Integer
- Oracle RAC 迁移至单机
- SharePoint online Multilingual support
- ssh 免密码登陆
- 项目中遇到 no matching editors or conversion strategy found
- Spring框架自我总结(一)
- vlc sdk下载
- PCA算法入门级讲解到深度挖掘
- CSS3基础——渐变
- 技术大牛养成指南,一篇不鸡汤的成功学实践
- 记另类Request method 'GET' not supported
- ContentProvider详解
- Geode 快速入门