• Spring 异常关键字 no matching editors or conversion strategy found 解决方法


    异常信息如下:

    Error creating bean with name 'sysLogAction' defined in file [E:\Workspace\eoms\ultrawf\WebRoot\WEB-INF\classes\spring\bjeoms-sysinfo.xml]: Cannot resolve reference to bean 'sysLogService' while setting bean property 'sysLogService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysLogService' defined in file [E:\Workspace\eoms\ultrawf\WebRoot\WEB-INF\classes\spring\bjeoms-sysinfo.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.ultrapower.eoms.common.dao.impl.HibernateDaoImpl] to required type [com.ultrapower.bjeoms.common.core.dao.IHibernateDao] for property 'hibernateDao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.ultrapower.eoms.common.dao.impl.HibernateDaoImpl] to required type [com.ultrapower.bjeoms.common.core.dao.IHibernateDao] for property 'hibernateDao': no matching editors or conversion strategy found

    相关配置信息如下:

    【bjeoms-sysinfo.xml】

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
    <beans default-autowire="byName" default-lazy-init="true">
        <!-- 系统日志信息 syslog start -->
        <bean id="sysLogAction" class="com.ultrapower.bjeoms.syslog.action.BJEomsSysLogAction" />
        <bean id="sysLogService" class="com.ultrapower.bjeoms.syslog.manager.BJEomsSysLogServiceImpl" />
        <!-- 系统日志信息 syslog end -->
    </beans>

    【dataAccessContext-hibernate.xml】

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
    <beans default-autowire="byName" default-lazy-init="true">    
            <bean >
                。。。 。。。
            </bean>
    <!--Hibernate TransactionManager-->
        <bean id="appSessionFactory" class="cn.com.ultrapower.eoms.common.basedao.GeneralDAO" lazy-init="false">
            <property name="hibernateSessionFactory" ref="sessionFactory" />
        </bean>
        
        <bean id="baseSessionFactory" class="cn.com.ultrapower.eoms.user.comm.hibernatesession.HibernateSessionFactory" lazy-init="false">
            <property name="hibernateSessionFactory" ref="sessionFactory" />
        </bean>
        <bean id="hibernateDao"  class="com.ultrapower.eoms.common.dao.impl.HibernateDaoImpl"/>
        <bean id="bjIDao"  class="com.ultrapower.bjeoms.common.core.dao.impl.HibernateDaoImpl"/>
    </beans>        

    异常说明 :在使用id="bjIDao"的实现类时,由于实现类中的set方法没有写成setBjIDao,而是copy bean id="hibernateDao"的setHibernateDao,导致映射的类不匹配。

    在功能迁移时,ctrl+c、ctrl+v 时要小心 ,注意~~~

  • 相关阅读:
    HDU--2024
    HDU--2021
    HDU--2020
    HDU--2019
    HDU--2018
    HDU--2017
    HDU--2016
    python全栈开发day13-迭代器、生成器、列表推导式等
    python全栈开发day12-函数的有用信息、带参数的装饰器、多个装饰器装饰一个函数、global和nonlocal的进一步解析和总结
    Python3使用Print输出带颜色字体
  • 原文地址:https://www.cnblogs.com/macula/p/3063450.html
Copyright © 2020-2023  润新知