为已存在的数据表增加两个字段,我在model.xml 增加了<resultmap 。。><result property="ba_p_begindate" column="BA_P_BEGINDATE" javaType="java.lang.String" />
<result property="ba_p_enddate" column="BA_P_ENDDATE" javaType="java.lang.String" />
</resultMap><insert id="insertBa" parameterClass="ParamBa">
<![CDATA[
    insert into WS_PEOPLE_BA (BA_CODE,BA_P_BEGINDATE,BA_P_ENDDATE)
    values #ba_code#,#ba_p_begindate#,#ba_p_enddate#)
]]>
</insert>并且在相应添加记录的类中增加了get和set的方法,但在初始化时,应用还是出现如下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [spring_common.xml]: Initialization of bean failed; nested exception is com.ibatis.common.exception.NestedRuntimeException: Error occurred.  
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  
Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  
Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/insert'.  
Cause: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'ba_p_begindate' in class 'com.bb.abroad.model.BaModel'
Caused by: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'ba_p_begindate' in class 'com.bb.abroad.model.BaModel'
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/insert'.  
Cause: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'ba_p_begindate' in class 'com.bb.abroad.model.BaModel'
是不是配置文件写的有错误,或者还有其他的配置和类文件需要修改更新???请赐教!

解决方案 »

  1.   

    'sqlMapClient' 在 spring_common.xml 中没有被注入你检查一下spring_common.xml关于sqlMapClient的配置
      

  2.   

     values #ba_code#,#ba_p_begindate#,#ba_p_enddate#)  values (#ba_code#,#ba_p_begindate#,#ba_p_enddate#) 少个第一个 括号
      

  3.   

    给你一个地址,你去看一下,会对你有帮助的http://www.blogjava.net/rain1102/articles/69853.html 自己对照一下,再检查一下自己的配置。
      

  4.   

    主要就是字段的配置 我增加了两个字段,没增加字段之前都是可以正常运转的;
    增加字段就在相应的model类中增加属性 get set ,在xml中增加了 resultmap 和插入值
    但还是提示model类中没有增加的属性,并且是在应用起来之后就提示错误?????
      

  5.   

    错误提示
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in class path resource [com/bb/eoa/eoa_spring_common.xml]: Initialization of bean failed; nested exception is com.ibatis.common.exception.NestedRuntimeException: Error occurred.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/insert'.  Cause: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'ba_p_begindate' in class 'com.bb.abroad.model.BaModel'eoa_spring_common.xml中没有特别的对字段修改就需要调整的语句,eoa_spring_common.xml调用了model.xml,在model.xml增加了属性和相应动作如
    <result property="ba_p_begindate" column="BA_P_BEGINDATE" javaType="java.lang.String" /> 
    <result property="ba_p_enddate" column="BA_P_ENDDATE" javaType="java.lang.String" /> 
    </resultMap> <insert id="insertBa" parameterClass="ParamBa"> 
    <![CDATA[ 
        insert into WS_PEOPLE_BA (BA_CODE,BA_P_BEGINDATE,BA_P_ENDDATE) 
        values #ba_code#,#ba_p_begindate#,#ba_p_enddate#) 
    ]]> 
    </insert> 
      

  6.   

    ba_p_begindate有对应的get方法吗
      

  7.   

    看报错好像是配置文件没有配好,另外5楼兄弟发现一个错: insert into WS_PEOPLE_BA (BA_CODE,BA_P_BEGINDATE,BA_P_ENDDATE) 
        values #ba_code#,#ba_p_begindate#,#ba_p_enddate#) ,
    values后少了一个“(”,不知是不是楼主贴过来的时候漏掉了?
      

  8.   

    ba_p_begindate有对应的get方法吗      有
    values后少了一个“(”,不知是不是楼主贴过来的时候漏掉了? 是我贴过来漏掉的 
      

  9.   

    好像是少了一个bean的属性在数据库中没有对应
      

  10.   

    parameterClass="ParamBa" 这个ParamBa的别名是?
    建议贴出完整代码