Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 84514 invoked from network); 14 Apr 2006 04:51:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Apr 2006 04:51:50 -0000 Received: (qmail 24433 invoked by uid 500); 14 Apr 2006 04:51:48 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 24407 invoked by uid 500); 14 Apr 2006 04:51:47 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 24396 invoked by uid 99); 14 Apr 2006 04:51:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Apr 2006 21:51:47 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=HTML_MESSAGE,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [194.78.225.115] (HELO mail5.persgroep.be) (194.78.225.115) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Apr 2006 21:51:45 -0700 In-Reply-To: To: user-java@ibatis.apache.org Subject: Re: java.lang.IllegalArgumentException MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.5.3 September 14, 2004 Message-ID: From: Tom.Stroobants@persgroep.be Date: Fri, 14 Apr 2006 06:51:22 +0200 X-MIMETrack: Serialize by Router on atlantis02/ALL(Release 6.5.3FP1|December 15, 2004) at 14/04/2006 06:51:23, Serialize complete at 14/04/2006 06:51:23 Content-Type: multipart/alternative; boundary="=_alternative 001AAD25C1257150_=" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multipart message in MIME format. --=_alternative 001AAD25C1257150_= Content-Type: text/plain; charset="US-ASCII" I replaced the int datatypes with the Integer objects and now it works ... I was using int's because I'm used to it ... "Larry Meadors" Sent by: larry.meadors@gmail.com 13/04/2006 16:12 Please respond to user-java@ibatis.apache.org To user-java@ibatis.apache.org cc Subject Re: java.lang.IllegalArgumentException Just curious: why are you using int instead of Integer? Larry On 4/13/06, Tom.Stroobants@persgroep.be wrote: > > > This is possble yes ... > I will try to replace my int with a wrapper class. > > Is there an option in IBATIS that can be used to to the casting automatically ? In the result resultmap ? > > Thanks ! > > > > > "I Gede Putu Sutarsa Giri Putra" > > 13/04/2006 11:20 > > Please respond to > > user-java@ibatis.apache.org > > > > To > > > > cc > > > Subject RE: java.lang.IllegalArgumentException > > > > > > > > > Can you send the domain class. > I guest there is a problem with your result class. Is the is primitive (i.e. int, long , char) type as the field in that class . If there is primitive type then try to replace it with the wrapper. Java.lang.Integer or java.lang.Long. > > > > ________________________________ > From: Tom.Stroobants@persgroep.be [mailto:Tom.Stroobants@persgroep.be] > Sent: Thursday, April 13, 2006 4:13 PM > To: user-java@ibatis.apache.org > Subject: java.lang.IllegalArgumentException > > > Dear all, > > I get on exception when using IBATIS on on Oracle database. > I have a table with some fields in it. One of the fields is a number field that can contain NULL values. > > I have defined a resultmap with the correct properties tags and also a valid result tag that stored its values in the resultmap. > > When selecting records where the number field is filled in there is no problem, when selecting records where the number fields (which can contain NULL values !!) is NULL I get the following exception: > > 500 Servlet Exception > java.lang.IllegalArgumentException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:45) > at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:112) > at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectValues(BasicResultMap.java:346) > at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:63) > at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:395) > at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:185) > at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205) > at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173) > at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123) > at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610) > at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584) > at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101) > at org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:245) > at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:181) > at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:204) > at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:243) > at be.persgroep.prj.hln.common.regio.dao.ibatis.ReactieDAO.getAllReacties(ReactieDAO.java:21) > at _jsp._regio._regiotest__jsp._jspService(regio/regioTest.jsp:26) > at com.caucho.jsp.JavaPage.service(JavaPage.java:60) > at com.caucho.jsp.Page.pageservice(Page.java:570) > at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:159) > at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178) > at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) > at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:267) > at com.caucho.server.port.TcpConnection.run(TcpConnection.java:388) > at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490) > at com.caucho.util.ThreadPool.run(ThreadPool.java:423) > at java.lang.Thread.run(Thread.java:595) > --=_alternative 001AAD25C1257150_= Content-Type: text/html; charset="US-ASCII"
I replaced the int datatypes with the Integer objects and now it works ...
I was using int's because I'm used to it ...



"Larry Meadors" <lmeadors@apache.org>
Sent by: larry.meadors@gmail.com

13/04/2006 16:12
Please respond to
user-java@ibatis.apache.org

To
user-java@ibatis.apache.org
cc
Subject
Re: java.lang.IllegalArgumentException





Just curious: why are you using int instead of Integer?

Larry


On 4/13/06, Tom.Stroobants@persgroep.be <Tom.Stroobants@persgroep.be> wrote:
>
>
> This is possble yes ...
> I will try to replace my int with a wrapper class.
>
> Is there an option in IBATIS that can be used to to the casting automatically ? In the result resultmap ?
>
> Thanks !
>
>
>
>
>  "I Gede Putu Sutarsa Giri Putra" <IGede.Sutarsa@vico.co.id>
>
> 13/04/2006 11:20
>
> Please respond to
>
>  user-java@ibatis.apache.org
>
>
>
> To
> <user-java@ibatis.apache.org>
>
>
> cc
>
>
> Subject RE: java.lang.IllegalArgumentException
>
>
>
>
>
>
>
>
> Can you send the domain class.
> I guest there is a problem with your result class. Is the is primitive (i.e. int, long , char) type as the field in that class . If there is primitive type then try to replace it with the wrapper. Java.lang.Integer or java.lang.Long.
>
>
>
>  ________________________________

> From: Tom.Stroobants@persgroep.be [mailto:Tom.Stroobants@persgroep.be]
>  Sent: Thursday, April 13, 2006 4:13 PM
>  To: user-java@ibatis.apache.org
>  Subject: java.lang.IllegalArgumentException
>
>
>  Dear all,
>
>  I get on exception when using IBATIS on on Oracle database.
>  I have a table with some fields in it. One of the fields is a number field that can contain NULL values.
>
>  I have defined a resultmap with the correct properties tags and also a valid result tag that stored its values in the resultmap.
>
>  When selecting records where the number field is filled in there is no problem, when selecting records where the number fields (which can contain NULL values !!) is NULL I get the following exception:
>
>  500 Servlet Exception
>  java.lang.IllegalArgumentException
>                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                  at java.lang.reflect.Method.invoke(Method.java:585)
>                  at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:45)
>                  at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:112)
>                  at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectValues(BasicResultMap.java:346)
>                  at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:63)
>                  at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:395)
>                  at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:185)
>                  at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
>                  at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
>                  at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
>                  at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
>                  at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
>                  at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
>                  at org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:245)
>                  at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:181)
>                  at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:204)
>                  at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:243)
>                  at be.persgroep.prj.hln.common.regio.dao.ibatis.ReactieDAO.getAllReacties(ReactieDAO.java:21)
>                  at _jsp._regio._regiotest__jsp._jspService(regio/regioTest.jsp:26)
>                  at com.caucho.jsp.JavaPage.service(JavaPage.java:60)
>                  at com.caucho.jsp.Page.pageservice(Page.java:570)
>                  at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:159)
>                  at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178)
>                  at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
>                  at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:267)
>                  at com.caucho.server.port.TcpConnection.run(TcpConnection.java:388)
>                  at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490)
>                  at com.caucho.util.ThreadPool.run(ThreadPool.java:423)
>                  at java.lang.Thread.run(Thread.java:595)
>

--=_alternative 001AAD25C1257150_=--