Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 16411 invoked from network); 13 Apr 2006 12:32:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Apr 2006 12:32:49 -0000 Received: (qmail 75087 invoked by uid 500); 13 Apr 2006 12:32:29 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 75069 invoked by uid 500); 13 Apr 2006 12:32:28 -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 75058 invoked by uid 99); 13 Apr 2006 12:32:28 -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 05:32:28 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [195.130.132.54] (HELO hoefnix.telenet-ops.be) (195.130.132.54) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Apr 2006 05:32:25 -0700 Received: from hoboe1bl6.telenet-ops.be (hoboe1bl6.telenet-ops.be [195.130.136.38]) by hoefnix.telenet-ops.be (Postfix) with ESMTP id 6F50DA9CAB for ; Thu, 13 Apr 2006 14:31:23 +0200 (CEST) Received: from hoboe1bl6.telenet-ops.be (localhost.localdomain [127.0.0.1]) by hoboe1bl6.telenet-ops.be (Postfix) with ESMTP id 58AEE388054 for ; Thu, 13 Apr 2006 14:31:23 +0200 (CEST) From: "Sven.Boden" To: user-java@ibatis.apache.org Importance: Normal Sensitivity: Normal Message-ID: X-Originating-IP: [192.85.50.2] X-Forwarded-For: [(null)] Date: Thu, 13 Apr 2006 12:31:23 +0000 Subject: Re: java.lang.IllegalArgumentException MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N For the moment nothing automatic exists. In the past some things have bee= n proposed but then you would still need to use some magic value to repre= sent NULLs in a primitive type, and that's not best practice. No need to create a JIRA for it... it already exists ;-) : http://issues.= apache.org/jira/browse/IBATIS-63 Regards, Sven >----- Oorspronkelijk bericht ----- >Van: Tom.Stroobants@persgroep.be [mailto:Tom.Stroobants@persgroep.be] >Verzonden: donderdag, april 13, 2006 11:42 AM >Aan: user-java@ibatis.apache.org >Onderwerp: RE: java.lang.IllegalArgumentException > >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.Intege= r >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 fie= ld >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 conta= in >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.jav= a:39) > at >sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor= Impl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at >com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(Pro= pertyAccessPlan.java:45) > at >com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanD= ataExchange.java:112) > at >com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectVa= lues(BasicResultMap.java:346) > at >com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResu= ltObject(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.sqlExecuteQu= ery(GeneralStatement.java:205) > at >com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery= WithCallback(GeneralStatement.java:173) > at >com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery= ForList(GeneralStatement.java:123) > at >com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMap= ExecutorDelegate.java:610) > at >com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMap= ExecutorDelegate.java:584) > at >com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessi= onImpl.java:101) > at >org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(S= qlMapClientTemplate.java:245) > at >org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClient= Template.java:181) > at >org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResul= t(SqlMapClientTemplate.java:204) > at >org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapC= lientTemplate.java:243) > at >be.persgroep.prj.hln.common.regio.dao.ibatis.ReactieDAO.getAllReacties(R= eactieDAO.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.ja= va:178) > at >com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.j= ava: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) >