Unable to instantiate Action, com.team.ehr.action.TrainAction, defined for 'train_trainExamine' in namespace '/'Error creating bean with name 'trainingService' defined in file [E:\apache-tomcat-6.0.14\webapps\ehr\WEB-INF\classes\applicationContext-service.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.team.ehr.dao.impl.TrainingDaoImpl] to required type [com.team.ehr.dao.TrainingIdDao] for property 'trainingIdDao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.team.ehr.dao.impl.TrainingDaoImpl] to required type [com.team.ehr.dao.TrainingIdDao] for property 'trainingIdDao': no matching editors or conversion strategy found
at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:307)
at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:388)
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:187)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:478)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'trainingService' defined in file [E:\apache-tomcat-6.0.14\webapps\ehr\WEB-INF\classes\applicationContext-service.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.team.ehr.dao.impl.TrainingDaoImpl] to required type [com.team.ehr.dao.TrainingIdDao] for property 'trainingIdDao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.team.ehr.dao.impl.TrainingDaoImpl] to required type [com.team.ehr.dao.TrainingIdDao] for property 'trainingIdDao': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:1029)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:977)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:329)
at com.opensymphony.xwork2.spring.SpringObjectFactory.autoWireBean(SpringObjectFactory.java:182)
at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:162)
at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:133)
at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:139)
at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:109)
at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:288)
... 28 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.team.ehr.dao.impl.TrainingDaoImpl] to required type [com.team.ehr.dao.TrainingIdDao] for property 'trainingIdDao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.team.ehr.dao.impl.TrainingDaoImpl] to required type [com.team.ehr.dao.TrainingIdDao] for property 'trainingIdDao': no matching editors or conversion strategy found
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
... 45 more
Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [com.team.ehr.dao.impl.TrainingDaoImpl] to required type [com.team.ehr.dao.TrainingIdDao] for property 'trainingIdDao': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
... 49 more
javawebjavaexceptionweb开发ssh
at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:307)
at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:388)
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:187)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:478)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'trainingService' defined in file [E:\apache-tomcat-6.0.14\webapps\ehr\WEB-INF\classes\applicationContext-service.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.team.ehr.dao.impl.TrainingDaoImpl] to required type [com.team.ehr.dao.TrainingIdDao] for property 'trainingIdDao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.team.ehr.dao.impl.TrainingDaoImpl] to required type [com.team.ehr.dao.TrainingIdDao] for property 'trainingIdDao': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:1029)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:977)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:329)
at com.opensymphony.xwork2.spring.SpringObjectFactory.autoWireBean(SpringObjectFactory.java:182)
at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:162)
at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:133)
at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:139)
at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:109)
at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:288)
... 28 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.team.ehr.dao.impl.TrainingDaoImpl] to required type [com.team.ehr.dao.TrainingIdDao] for property 'trainingIdDao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.team.ehr.dao.impl.TrainingDaoImpl] to required type [com.team.ehr.dao.TrainingIdDao] for property 'trainingIdDao': no matching editors or conversion strategy found
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
... 45 more
Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [com.team.ehr.dao.impl.TrainingDaoImpl] to required type [com.team.ehr.dao.TrainingIdDao] for property 'trainingIdDao': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
... 49 more
javawebjavaexceptionweb开发ssh
解决方案 »
- wsdl2java如何生成客户端代码?
- 谁有格式化代码的插件?
- weblogic8.1支持jsp2.0和servlet2.4吗
- eclipse关键字显示乱码,非中文问题,谁遇到过
- JSP的配置问题(大虾求救)
- [求助]在jsp中怎麼讀取控件的值??高手幫忙
- 最常用的js
- 3/7:doStartTag,doEndTag,doAfterBody都什么意思?标签开始,结束,在标签体后?
- 新的问题出现了
- String to int类型转换问题(我郁闷有两个小时了)
- java.lang.NoSuchMethodException 出现怎么解决
- cxf spring搭建webservices应用 C#调用报错
你看看spring文件中是不是写漏了,或者TrainingDaoImpl中没写TrainingIdDao对象的set方法。
package com.team.ehr.dao.impl;
import java.io.Serializable;
import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import com.team.ehr.dao.TrainingDao;
import com.team.ehr.entity.Training;
public class TrainingDaoImpl extends BaseDao implements TrainingDao {
public void delete(Training training) {
// TODO Auto-generated method stub
super.delete(training);
}
public void save(Training training) {
// TODO Auto-generated method stub
super.save(training);
}
public void update(Training training) {
// TODO Auto-generated method stub
super.update(training);
}
public List<Training> getAll() {
// TODO Auto-generated method stub
DetachedCriteria criteria=DetachedCriteria.forClass(Training.class);
return super.findByCriteria(criteria);
}
public Training get(Serializable id) {
// TODO Auto-generated method stub
return (Training) super.get(Training.class, id);
}
}
spring代码三个applicationContext.xml里的
<bean id="trainingIdAction" class="com.team.ehr.action.TrainAction">
<property name="trainingService" ref="trainingService"></property>
</bean>
<bean id="trainingIdDao" class="com.team.ehr.dao.impl.TrainingDaoImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="trainingService" class="com.team.ehr.service.impl.TrainingServiceImpl">
<property name="trainingIdDao" ref="trainingIdDao"></property>
</bean>
private TrainingIdDao trainingIdDao;
public setTrainingIdDao(TrainingIdDao trainingIdDao) {
this.trainingIdDao = trainingIdDao;
}