You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by cuong PN <pn...@yahoo.com> on 2007/08/23 08:11:29 UTC

InlineParameterMap exception

Hi all

Here's an exception that I got while using SQLMaps:

com.ibatis.dao.client.DaoException: Failed to queryForList - id
[DBSmPaymentPmGetObjByShiftDtFromTo], parameterObject
[com.sums.entity.SmPaymentPm@f026c0].  Cause:
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred while applying a parameter map.
--- Check the DBSmPaymentPmGetObjByShiftDtFromTo-InlineParameterMap.
--- Check the parameter mapping for the 'paidI' property.
--- Cause: java.sql.SQLException: Invalid column type
Caused by: java.sql.SQLException: Invalid column type
        at
com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(SqlMapDaoTemplate.java:284)
        at
com.sums.implementation.SumsDaoImpl.getDetails(SumsDaoImpl.java:40)
        at sun.reflect.GeneratedMethodAccessor277.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:72)
        at $Proxy17.getDetails(Unknown Source)
        at
com.sums.beans.JobPaymentEnquiryRetrieveBean.validate(JobPaymentEnquiryRetrieveBean.java:269)
        at com.portnet.base.BaseServlet.doPost(BaseServlet.java:318)
        at com.portnet.base.SecureServlet.doPost(SecureServlet.java:53)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
        at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)
        at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
        at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)


And here's the xml (some data obmitted):

<select id="..." resultMap="..." parameterClass="...">
select * from atable
where
((#acptI# IS NULL OR (#acptI# IS NOT NULL AND ACPT_I = #acptI#) OR (#acptI#
IS NOT NULL AND #acptI# = 'N' AND ACPT_I IS NULL)) 
AND  (#paidI# IS NULL OR (#paidI# IS NOT NULL AND PAID_I = #paidI#) OR
(#paidI# IS NOT NULL AND #paidI# = 'N' AND PAID_I IS NULL)))
	<isNotNull prepend = "and" property = "shftDt">
		SHFT_DT <![CDATA[>=]]>#shftDt:VARCHAR#
	</isNotNull>
	<isNotNull prepend = "and" property = "shftDtTo">
		SHFT_DT <![CDATA[<=]]>#shftDtTo:VARCHAR#
	</isNotNull>
  				     
      <isNotEmpty prepend = "and" property = "jobId"> JOB_ID=#jobId#
</isNotEmpty>
      <isNotEmpty prepend = "and" property = "acptId">
ACPT_ID=#acptId:VARCHAR# </isNotEmpty>
      <isNotEmpty prepend = "and" property = "acptDt">
ACPT_DT=#acptDt:VARCHAR# </isNotEmpty>
      <isNotEmpty prepend = "and" property = "apprId">
APPR_ID=#apprId:VARCHAR#  </isNotEmpty>
      <isNotEmpty prepend = "and" property = "apprDt">
APPR_DT=#apprDt:VARCHAR# </isNotEmpty>
      <isNotEmpty prepend = "and" property = "disputeI">
DISPUTE_I=#disputeI:VARCHAR# </isNotEmpty>
      <isNotEmpty prepend = "and" property = "usrId"> USR_ID=#usrId#
</isNotEmpty>
    </select>


The interesting thing is that it runs fine on one server, but on another it
throws such exception. Any help? Thanks so much!
cuong
-- 
View this message in context: http://www.nabble.com/InlineParameterMap-exception-tf4315664.html#a12288081
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: InlineParameterMap exception

Posted by cuong PN <pn...@yahoo.com>.
Hi Brandon

Thanks for replying. We've found the solution. Our column type is VARCHAR
and the param object is of type String. For that aspect, it's alright. But
problem comes when we don't set value for paidI (which is an inline
parameter) and hence it's null. Our old jdbc driver doesn't know what to do
and so throws an error. It's fixed by putting specific SQL type in the xml:

#paidI:VARCHAR#

That works!

Cuong


What is the type of your database column and what is the property type on
your parameter object? This error appears pretty self explanatory. But, I'm
willing to help if you provide some clearer details.

Thanks,
Brandon

-- 
View this message in context: http://www.nabble.com/InlineParameterMap-exception-tf4315664.html#a12340484
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: InlineParameterMap exception

Posted by Brandon Goodin <br...@gmail.com>.
What is the type of your database column and what is the property type on
your parameter object? This error appears pretty self explanatory. But, I'm
willing to help if you provide some clearer details.

Thanks,
Brandon

On 8/23/07, cuong PN <pn...@yahoo.com> wrote:
>
>
> Hi all
>
> Here's an exception that I got while using SQLMaps:
>
> com.ibatis.dao.client.DaoException: Failed to queryForList - id [someid],
> parameterObject [someobject@f026c0].  Cause:
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred while applying a parameter map.
> --- Check the someid-InlineParameterMap.
> --- Check the parameter mapping for the 'paidI' property.
> --- Cause: java.sql.SQLException: Invalid column type
> Caused by: java.sql.SQLException: Invalid column type
>         at
> com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(
> SqlMapDaoTemplate.java:284)
>         at
> com.sums.implementation.SumsDaoImpl.getDetails(SumsDaoImpl.java:40)
>         at sun.reflect.GeneratedMethodAccessor277.invoke(Unknown Source)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:72)
>         at $Proxy17.getDetails(Unknown Source)
>         ...
>
> And here's the xml (some data obmitted):
>
> <select id="..." resultMap="..." parameterClass="...">
> select * from atable
> where
> ((#acptI# IS NULL OR (#acptI# IS NOT NULL AND ACPT_I = #acptI#) OR
> (#acptI#
> IS NOT NULL AND #acptI# = 'N' AND ACPT_I IS NULL))
> AND  (#paidI# IS NULL OR (#paidI# IS NOT NULL AND PAID_I = #paidI#) OR
> (#paidI# IS NOT NULL AND #paidI# = 'N' AND PAID_I IS NULL)))
>         <isNotNull prepend = "and" property = "shftDt">
>                 SHFT_DT <![CDATA[>=]]>#shftDt:VARCHAR#
>         </isNotNull>
>         <isNotNull prepend = "and" property = "shftDtTo">
>                 SHFT_DT <![CDATA[<=]]>#shftDtTo:VARCHAR#
>         </isNotNull>
>
>       <isNotEmpty prepend = "and" property = "jobId"> JOB_ID=#jobId#
> </isNotEmpty>
>       <isNotEmpty prepend = "and" property = "acptId">
> ACPT_ID=#acptId:VARCHAR# </isNotEmpty>
>       <isNotEmpty prepend = "and" property = "acptDt">
> ACPT_DT=#acptDt:VARCHAR# </isNotEmpty>
>       <isNotEmpty prepend = "and" property = "apprId">
> APPR_ID=#apprId:VARCHAR#  </isNotEmpty>
>       <isNotEmpty prepend = "and" property = "apprDt">
> APPR_DT=#apprDt:VARCHAR# </isNotEmpty>
>       <isNotEmpty prepend = "and" property = "disputeI">
> DISPUTE_I=#disputeI:VARCHAR# </isNotEmpty>
>       <isNotEmpty prepend = "and" property = "usrId"> USR_ID=#usrId#
> </isNotEmpty>
>     </select>
>
>
> The interesting thing is that it runs fine on one server, but on another
> it
> throws such exception. Any help? Thanks so much!
> cuong
> --
> View this message in context:
> http://www.nabble.com/InlineParameterMap-exception-tf4315664.html#a12288081
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>