在做项目时,需要搭建一个SSH 的J2EE程序 出现了一个奇怪错误,而且我的配置文件和jar包都没有问题,在网上找了很多答案但都不能解决问题。
错误:
原因是:使用 spring 依赖注入时,实现类没有实现所注入的接口。
当然 缺少jar包和jar包重复以及配置文件有误也会发生这种错误。
错误:
信息: SessionListener: contextInitialized()
2009-08-25 16:57:14,421 [org.springframework.web.struts.ContextLoaderPlugIn]-[ERROR]
Context initialization failed
org.springframework.beans.factory.BeanCreationException: [color=red]Error creating bean with name 'userBiz' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:[/color]PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.cyy.sp.dao.impl.CyySpUserinfoDAO] to required type [com.cyy.sp.dao.ICyySpUserinfoDAO] for property 'userDao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.cyy.sp.dao.impl.CyySpUserinfoDAO] to required type [com.cyy.sp.dao.ICyySpUserinfoDAO] for property 'userDao': no matching editors or conversion strategy found
Caused by:
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.cyy.sp.dao.impl.CyySpUserinfoDAO] to required type [com.cyy.sp.dao.ICyySpUserinfoDAO] for property 'userDao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.cyy.sp.dao.impl.CyySpUserinfoDAO] to required type [com.cyy.sp.dao.ICyySpUserinfoDAO] for property 'userDao': no matching editors or conversion strategy found
Caused by:
java.lang.IllegalArgumentException: Cannot convert value of type [com.cyy.sp.dao.impl.CyySpUserinfoDAO] to required type [com.cyy.sp.dao.ICyySpUserinfoDAO] for property 'userDao': no matching editors or conversion strategy found
。。。 。。。
原因是:使用 spring 依赖注入时,实现类没有实现所注入的接口。
当然 缺少jar包和jar包重复以及配置文件有误也会发生这种错误。