Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'districtService' defined in file [F:\Program Files\apache-tomcat-6.0.18\webapps\pengyun\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.pengyun.dao.impl.SceneryDaoImpl] to required type [com.pengyun.dao.DistrictDao] for property 'districtDao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.pengyun.dao.impl.SceneryDaoImpl] to required type [com.pengyun.dao.DistrictDao] for property 'districtDao': no matching editors or conversion strategy found
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.pengyun.dao.impl.SceneryDaoImpl] to required type [com.pengyun.dao.DistrictDao] for property 'districtDao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.pengyun.dao.impl.SceneryDaoImpl] to required type [com.pengyun.dao.DistrictDao] for property 'districtDao': no matching editors or conversion strategy found
Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [com.pengyun.dao.impl.SceneryDaoImpl] to required type [com.pengyun.dao.DistrictDao] for property 'districtDao': no matching editors or conversion strategy found
2012-10-12 16:23:27 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2012-10-12 16:23:27 org.apache.catalina.core.StandardContext start
在这里我吗、并没有要实现DistrictDao的想法,也根本不用实现它,可是错误出在这里,是很纠结的啊
------解决方案--------------------------------------------------------
org.springframework.beans.TypeMismatchException:
Failed to convert property value of type [com.pengyun.dao.impl.SceneryDaoImpl]
to required type [com.pengyun.dao.DistrictDao] for property 'districtDao';
问楼主:
'districtService' 是怎么注入DAO的?
------解决方案--------------------------------------------------------
districtService 缺少 'districtDao'; set and get method
------解决方案--------------------------------------------------------
districtService 缺少 'districtDao'; set and get method 同時檢查下 districtDao在配置文件裏面是否有定義
------解决方案--------------------------------------------------------