把<bean id="userInfoImp"   class="spring.dao.UserInfoImp"/> 
</beans> 改成<bean id="userInfoImp"   class="spring.dao.UserInfoImp"/> 
<ref   local="sessionFactory"/> 
</beans> 

解决方案 »

  1.   

    还是不行,报错:
    Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator' defined in class path resource [spring/dao/beans1.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [spring.dao.UserInfoImp] to required type [java.lang.String[]] for property 'beanNames'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [spring.dao.UserInfoImp] to required type [java.lang.String] for property 'beanNames[0]': no matching editors or conversion strategy found
    Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
    PropertyAccessException 1:
      

  2.   

    你的属性设置或引用出错了,自己仔细检查一下,注意这里的错误: Failed   to   convert   property   value   of   type   [spring.dao.UserInfoImp]   to   required   type   [java.lang.String[]]   for   property   'beanNames';   nested   exception   is   java.lang.IllegalArgumentException:   Cannot   convert   value   of   type   [spring.dao.UserInfoImp]   to   required   type   [java.lang.String]   for   property   'beanNames[0]':   no   matching   editors   or   conversion   strategy   found 
      

  3.   

    是少了jar包 少这个 commons-pool.jar这包