Uploaded image for project: 'iBatis for Java [READ ONLY]'
  1. iBatis for Java [READ ONLY]
  2. IBATIS-723

NullPointerException--while resultMap subselect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.3.0
    • None
    • Core
    • None
    • linux

    Description

      I cann't reproduce the problem by running unit test.
      and my spring config like this :
      <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName">
      <value>someDataSource</value>
      </property>
      </bean>
      <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
      <property name="dataSource" ref="dataSource" />
      <property name="configLocation" value="classpath:/sqlmap.xml" />
      </bean>

      my sqlmap like this:
      <resultMap id="RM-EXTFREEINFO" class="com.alipay.mktmng.biz.dal.dataobject.FreeinfoExtDO">
      <result property="userId" column="USER_ID" javaType="java.lang.String" jdbcType="VARCHAR2"/>
      <result property="usersurveys" column="USER_ID" select="getUserSurveys" />
      </resultMap>
      <select id="MS-FREEINFO-SELECT-FREE-EXT-INFO-BY-USER-ID" resultMap="RM-EXTFREEINFO">
      <![CDATA[
      select * from freeinfo_table where (user_id = #value#)
      ]]>
      </select>
      <select id="getUserSurveys" resultMap="RM-FREE-USERSURVEY-INFO">
      <![CDATA[
      select * from usersurvey_table u where u.user_id = #userId#
      ]]>
      </select>

      the error.log trace:
      dbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
      — The error occurred in xxxxx-sqlmap-mapping.xml.
      — The error occurred while applying a result map.
      — Check the apaymkt.RM-EXTFREEINFO.
      — Check the result mapping for the 'usersurveys' property.
      — Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
      — The error occurred in xxxxx-sqlmap-mapping.xml.
      — The error occurred while applying a result map.
      — Check the RM-EXTFREEINFO.
      — Check the result mapping for the 'usersurveys' property.
      — Cause: java.lang.NullPointerException

      Attachments

        Activity

          People

            Unassigned Unassigned
            ask_question@apache ask_question@apache
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified