zoukankan      html  css  js  c++  java
  • 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 时要小心 ,注意~~~

  • 相关阅读:
    Web 前端开发中一些兼容性问题及其解决办法 (持续更)
    沈逸的IT专栏---shenyisyn
    程序员该做的事
    职场需要切忌的几点——《程序员,你伤不起》
    百度天气API接口
    C#简单音乐播放器ListBox歌单列表
    CentOS7 安装java(jre 1.8)
    CentOS7 系统安装与设置
    这个可以有,记录下
    在centos 7中让网卡自启动
  • 原文地址:https://www.cnblogs.com/macula/p/3063450.html
Copyright © 2011-2022 走看看