日期:2014-05-20  浏览次数:20755 次

spring注入,提示Invalid property name 'CodedbDao' - not JavaBean compliant
applicationContext.xml:
XML code
    <bean id="LoginCodedbDAO" class="com.zjm.ssh2.login.dao.hibernate.CodedbDAO">
        <property name="sessionFactory">
            <ref bean="sessionFactory" />
        </property>
    </bean>
    <bean id="LoginCodeService" class="com.zjm.ssh2.login.services.CodeService">
        <property name="CodedbDao">     <!--[color=#FF0000]这行报错[/color]-->
            <ref bean="LoginCodedbDAO" />
        </property>
    </bean>



CodeService.java:
Java code
package com.zjm.ssh2.login.services;

import com.zjm.ssh2.login.dao.iface.ICodedbDAO;
import com.zjm.ssh2.login.services.iface.ICodeService;

public class CodeService implements ICodeService {
    public ICodedbDAO CodedbDao;

    public ICodedbDAO getCodedbDao() {
        return CodedbDao;
    }

    public void setCodedbDao(ICodedbDAO codedbDao) {
        CodedbDao = codedbDao;
    }
}


CodedbDAO.java
Java code
import com.zjm.ssh2.login.dao.iface.ICodedbDAO;
public class CodedbDAO extends HibernateDaoSupport implements ICodedbDAO {
......
}



applicationContext.xml文件里<property name="CodedbDao">这行报错:Invalid property name 'CodedbDao' - not JavaBean compliant
请问怎么回事

------解决方案--------------------
JavaBean 规范

请把首字母改小写试试