org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/login' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [com.tony.hr.biz.UsersBiz] for property 'usersBiz'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [com.tony.hr.biz.UsersBiz] for property 'usersBiz': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478)

解决方案 »

  1.   

    bean name '/login'中
    usersBiz的值应为com.tony.hr.biz.UsersBiz类型,但传了个String类型的值进去了,
    再看下配置吧
      

  2.   

    创建bean类型不匹配,转换错了,错误很明显的啊!
      

  3.   

    我解决了  <!-- ACTION -->
    <bean name="/login" class="com.tony.hr.web.action.LoginAction">
    <property name="usersBiz" ref="usersBiz"></property>
    </bean>ref 写成 那么了 -——-
      

  4.   

        <!-- ACTION -->
        <bean name="/login" class="com.tony.hr.web.action.LoginAction">
            <property name="usersBiz" ref="usersBiz"></property>
        </bean>写成    <!-- ACTION -->
        <bean name="/login" class="com.tony.hr.web.action.LoginAction">
            <property name="usersBiz" name="usersBiz"></property>
        </bean>