Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 12039 invoked from network); 5 Dec 2006 02:36:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2006 02:36:05 -0000 Received: (qmail 79667 invoked by uid 500); 5 Dec 2006 02:36:10 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 79651 invoked by uid 500); 5 Dec 2006 02:36:10 -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 79640 invoked by uid 99); 5 Dec 2006 02:36:10 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Dec 2006 18:36:10 -0800 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=HTML_MESSAGE,RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jeffgbutler@gmail.com designates 66.249.92.174 as permitted sender) Received: from [66.249.92.174] (HELO ug-out-1314.google.com) (66.249.92.174) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Dec 2006 18:35:59 -0800 Received: by ug-out-1314.google.com with SMTP id m2so2882103ugc for ; Mon, 04 Dec 2006 18:35:37 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Dj4pbj7h5fgE7oPVYda7wMOLAEhMvO6P9jKSAEqdSqp9hlMjE8hos749pXYcmHTizGsd5H4T6lxCQvWrvZqxmOLCK60OrHdaE/ZR3qkwGVT30eMmaD1bezWBHT2BEh2PtDj2yjTar3bdlfb/fEqTHI/9rtHO9VxAR5Ih7D9bNCE= Received: by 10.78.203.13 with SMTP id a13mr8425472hug.1165286137151; Mon, 04 Dec 2006 18:35:37 -0800 (PST) Received: by 10.78.153.12 with HTTP; Mon, 4 Dec 2006 18:35:37 -0800 (PST) Message-ID: Date: Mon, 4 Dec 2006 20:35:37 -0600 From: "Jeff Butler" To: user-java@ibatis.apache.org Subject: Re: n+1 Problem NullPointerException In-Reply-To: <4574D1A4.6050906@clarksnutrition.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_52046_30896298.1165286137099" References: <456FA23C.20304@clarksnutrition.com> <456FEE6B.3020506@googlemail.com> <4570BEBE.2010804@clarksnutrition.com> <4570CCBB.6090405@clarksnutrition.com> <45749309.502@clarksnutrition.com> <4574D1A4.6050906@clarksnutrition.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_52046_30896298.1165286137099 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Something is very odd. The line numbers in the stack trace are nowhere near the current line numbers - I had to go back over 2 years to find a match. So I think part of the problem is that there is a really old version of iBATIS somewhere in your classpath. Please make sure that you are using a current version of iBATIS, and that all old version are removed from the classpath. That should help a lot! Jeff Butler On 12/4/06, Warren wrote: > > I tried changing the int properties to Integer and I am still getting > the same exceptions. I guess it is time to give up. Thanks for everyones > help. > > Warren wrote: > > I will give it a try. I don't seem to have this problem with other > > sqlMaps I am using. This is the first n+1 I have tried. Is this the > > Exception that leads you to believe that it is a primitive mapping > > problem: > > > > > com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getPrimitiveResultMappingValue > (BasicResultMap.java:268) > > > > > > Jeff Butler wrote: > >> Thanks for the stack trace. > >> > >> I'll have to look into this a little further. iBATIS is a little > >> finicky when it comes to using primitive types. You might have > >> better luck if you changed to using Integer instead of int for the > >> primary keys. > >> > >> Jeff Butler > >> > >> > >> On 12/1/06, *Warren* >> > wrote: > >> > >> Caused by: com.ibatis.dao.client.DaoException: Error executing > >> query for > >> list. Cause: com.ibatis.common.jdbc.exception.NestedSQLException : > >> --- The error occurred in > >> > >> com/clarks/spanky/persistence/sqlmapdao/sql/postgres/batchOrder- > postgres.xml. > >> > >> > >> --- The error occurred while applying a result map. > >> --- Check the BatchOrder.catItemsResults. > >> --- Check the result mapping for the 'items' property. > >> --- Cause: java.lang.NullPointerException > >> Caused by: java.lang.NullPointerException > >> Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: > >> --- The error occurred in > >> com/clarks/spanky/persistence/sqlmapdao/sql/postgres/batchOrder- > >> postgres.xml. > >> > >> --- The error occurred while applying a result map. > >> --- Check the BatchOrder.catItemsResults. > >> --- Check the result mapping for the 'items' property. > >> --- Cause: java.lang.NullPointerException > >> Caused by: java.lang.NullPointerException > >> at > >> > >> > com.clarks.spanky.persistence.sqlmapdao.BaseSqlMapDao.executeQueryForList( > BaseSqlMapDao.java:35) > >> > >> at > >> > >> > com.clarks.spanky.persistence.sqlmapdao.BatchOrderSqlMapDao.getBatchedItemPromoPrices > >> > >> (BatchOrderSqlMapDao.java:270) > >> ... 34 more > >> Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: > >> --- The error occurred in > >> > >> com/clarks/spanky/persistence/sqlmapdao/sql/postgres/batchOrder- > postgres.xml > >> > >> . > >> > >> --- The error occurred while applying a result map. > >> --- Check the BatchOrder.catItemsResults. > >> --- Check the result mapping for the 'items' property. > >> --- Cause: java.lang.NullPointerException > >> Caused by: java.lang.NullPointerException > >> at > >> > >> > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback > (GeneralStatement.java:155) > >> > >> at > >> > >> > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList > >> > >> (GeneralStatement.java:95) > >> at > >> > >> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList( > SqlMapExecutorDelegate.java:247) > >> > >> at > >> > >> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList( > SqlMapExecutorDelegate.java > >> > >> :232) > >> at > >> > >> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList( > SqlMapSessionImpl.java:71) > >> > >> at > >> > >> com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList( > SqlMapClientImpl.java:49) > >> > >> at > >> > >> > com.clarks.spanky.persistence.sqlmapdao.BaseSqlMapDao.executeQueryForList > >> > >> (BaseSqlMapDao.java:32) > >> ... 35 more > >> Caused by: java.lang.NullPointerException > >> at > >> > >> > com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getPrimitiveResultMappingValue > (BasicResultMap.java:268) > >> > >> at > >> > >> com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults( > BasicResultMap.java:107) > >> > >> at > >> > >> com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults( > SqlExecutor.java:274) > >> > >> at > >> com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery > >> (SqlExecutor.java:125) > >> at > >> > >> > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery > (GeneralStatement.java:172) > >> > >> at > >> > >> > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback > >> > >> (GeneralStatement.java:139) > >> ... 41 more > >> > >> > >> Jeff Butler wrote: > >> > Sorry for your frustration, but you'll have to tell us where the > >> > NullPointerException is coming from. Could you post a stack > >> trace? > >> > > >> > Jeff Butler > >> > > >> > > ------=_Part_52046_30896298.1165286137099 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Something is very odd.  The line numbers in the stack trace are nowhere near the current line numbers - I had to go back over 2 years to find a match.  So I think part of the problem is that there is a really old version of iBATIS somewhere in your classpath.
 
Please make sure that you are using a current version of iBATIS, and that all old version are removed from the classpath.  That should help a lot!
 
Jeff Butler


 
On 12/4/06, Warren <warren@clarksnutrition.com> wrote:
I tried changing the int properties to Integer and I am still getting
the same exceptions. I guess it is time to give up. Thanks for everyones
help.

Warren wrote:
> I will give it a try. I don't seem to have this problem with other
> sqlMaps I am using. This is the first n+1 I have tried. Is this the
> Exception that leads you to believe that it is a primitive mapping
> problem:
>
> com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getPrimitiveResultMappingValue(BasicResultMap.java:268)
>
>
> Jeff Butler wrote:
>> Thanks for the stack trace.
>>
>> I'll have to look into this a little further.  iBATIS is a little
>> finicky when it comes to using primitive types.  You might have
>> better luck if you changed to using Integer instead of int for the
>> primary keys.
>>
>> Jeff Butler
>>
>>
>> On 12/1/06, *Warren* <warren@clarksnutrition.com
>> <mailto: warren@clarksnutrition.com>> wrote:
>>
>>     Caused by: com.ibatis.dao.client.DaoException: Error executing
>>     query for
>>     list.  Cause: com.ibatis.common.jdbc.exception.NestedSQLException :
>>     --- The error occurred in
>>
>> com/clarks/spanky/persistence/sqlmapdao/sql/postgres/batchOrder-postgres.xml.
>>
>>
>>     --- The error occurred while applying a result map.
>>     --- Check the BatchOrder.catItemsResults.
>>     --- Check the result mapping for the 'items' property.
>>     --- Cause: java.lang.NullPointerException
>>     Caused by: java.lang.NullPointerException
>>     Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
>>     --- The error occurred in
>>     com/clarks/spanky/persistence/sqlmapdao/sql/postgres/batchOrder-
>>     postgres.xml.
>>
>>     --- The error occurred while applying a result map.
>>     --- Check the BatchOrder.catItemsResults.
>>     --- Check the result mapping for the 'items' property.
>>     --- Cause: java.lang.NullPointerException
>>     Caused by: java.lang.NullPointerException
>>        at
>>
>> com.clarks.spanky.persistence.sqlmapdao.BaseSqlMapDao.executeQueryForList (BaseSqlMapDao.java:35)
>>
>>        at
>>
>> com.clarks.spanky.persistence.sqlmapdao.BatchOrderSqlMapDao.getBatchedItemPromoPrices
>>
>>     (BatchOrderSqlMapDao.java :270)
>>        ... 34 more
>>     Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
>>     --- The error occurred in
>>
>> com/clarks/spanky/persistence/sqlmapdao/sql/postgres/batchOrder- postgres.xml
>>
>>     .
>>
>>     --- The error occurred while applying a result map.
>>     --- Check the BatchOrder.catItemsResults.
>>     --- Check the result mapping for the 'items' property.
>>     --- Cause: java.lang.NullPointerException
>>     Caused by: java.lang.NullPointerException
>>        at
>>
>> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback (GeneralStatement.java:155)
>>
>>        at
>>
>> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList
>>
>>     (GeneralStatement.java:95)
>>        at
>>
>> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:247)
>>
>>        at
>>
>> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList (SqlMapExecutorDelegate.java
>>
>>     :232)
>>        at
>>
>> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:71)
>>
>>        at
>>
>> com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:49)
>>
>>        at
>>
>> com.clarks.spanky.persistence.sqlmapdao.BaseSqlMapDao.executeQueryForList
>>
>>     (BaseSqlMapDao.java:32)
>>        ... 35 more
>>     Caused by: java.lang.NullPointerException
>>        at
>>
>> com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getPrimitiveResultMappingValue (BasicResultMap.java:268)
>>
>>        at
>>
>> com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults(BasicResultMap.java:107)
>>
>>        at
>>
>> com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:274)
>>
>>        at
>>     com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery
>>     (SqlExecutor.java :125)
>>        at
>>
>> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:172)
>>
>>        at
>>
>> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback
>>
>>     (GeneralStatement.java:139)
>>        ... 41 more
>>
>>
>>     Jeff Butler wrote:
>>     > Sorry for your frustration, but you'll have to tell us where the
>>     > NullPointerException is coming from.  Could you post a stack
>> trace?
>>     >
>>     > Jeff Butler
>>     >
>>


------=_Part_52046_30896298.1165286137099--