Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 33374 invoked from network); 9 Feb 2011 18:20:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2011 18:20:08 -0000 Received: (qmail 53942 invoked by uid 500); 9 Feb 2011 18:20:07 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 52929 invoked by uid 500); 9 Feb 2011 18:20:04 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 52907 invoked by uid 99); 9 Feb 2011 18:20:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Feb 2011 18:20:03 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [216.82.241.83] (HELO mail37.messagelabs.com) (216.82.241.83) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Feb 2011 18:19:57 +0000 X-VirusChecked: Checked X-Env-Sender: PBortnovskiy@Jefferies.com X-Msg-Ref: server-4.tower-37.messagelabs.com!1297275575!75115422!1 X-StarScan-Version: 6.2.9; banners=-,-,- X-Originating-IP: [169.196.176.23] Received: (qmail 7295 invoked from network); 9 Feb 2011 18:19:35 -0000 Received: from jefsmtp11.jefferies.com (HELO JEFSMTP11.dmz.jefco.local) (169.196.176.23) by server-4.tower-37.messagelabs.com with RC4-SHA encrypted SMTP; 9 Feb 2011 18:19:35 -0000 In-Reply-To: <4D52CDAE.8060001@sbcglobal.net> References: <4D52CDAE.8060001@sbcglobal.net> To: "Derby Discussion" Cc: Derby Discussion MIME-Version: 1.0 Subject: Re: NullPointerException deep in Derby X-KeepSent: 8E299991:F7FA8F0B-85257832:00646C17; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.2 August 10, 2010 From: Pavel Bortnovskiy Message-ID: Date: Wed, 9 Feb 2011 13:19:30 -0500 X-MIMETrack: Serialize by Router on JefSMTP11/JEFCO(Release 8.5.2 HF324|December 06, 2010) at 02/09/2011 01:19:36 PM, Serialize complete at 02/09/2011 01:19:36 PM Content-Type: multipart/alternative; boundary="=_alternative 0064AA4A85257832_=" This is a multipart message in MIME format. --=_alternative 0064AA4A85257832_= Content-Type: text/plain; charset="US-ASCII" Hello, Kathey: thank you for prompt response. I was running 10.6. Upgraded to 10.7 and encountered the same NPE. Downgraded to 10.3 and 10.2 but got a different error Caused by: java.sql.SQLException: No suitable driver found for jdbc:derby:memory:testdb;create=true What could be a problem there? From: Kathey Marsden To: Derby Discussion Cc: Pavel Bortnovskiy Date: 02/09/2011 12:45 PM Subject: Re: NullPointerException deep in Derby On 2/9/2011 7:49 AM, Pavel Bortnovskiy wrote: Additional information: the message "executing statement after shutdown" is misleading. There was no shutdown occurring and the connection was open and valid. Our query (which I cannot show here for now) was complex, with case statements and group by. Interestingly, as soon as the query was reworked to remove group by clause, the code worked flawlessly. P. Hi Pavel, Since your problem is in generated code it is hard to figure out what went wrong without more information. Firstly, I was wondering what version of Derby you are using? I would suggest moving to the latest release, 10.7 if you are not already there to see if the problem still exists. If it does, run your query with: derby.debug.true=DumpClassFile and it will dump the generated class file which you can decompile and perhaps get a clue where the problem lies. I don't think that Derby should ever throw this NPE, so I would say at least file a Jira bug with the information that you can share and the stack trace. As a further diagnostic step, there was a major rework and clean up of group by in 10.3, DERBY-681 which resulted in some regressions. Usually when I see a group by issue, I will first try the build before and after that change to see if it might be related. If you don't want to build Derby, as a first step it would be interesting to see if occurs with 10.3. but not 10.2 to see if DERBY-681 is suspect. Thanks Kathey From: Pavel Bortnovskiy To: Derby Discussion Date: 02/09/2011 10:43 AM Subject: NullPointerException deep in Derby Hello: I just got the following NullPointerException, seemingly inside Derby code: 2011-02-09 10:39:13,576 ERROR DataProcessor - SQL Exception due to executing statement after shutdown java.sql.SQLException: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(UnknownSource) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(UnknownSource) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedResultSet.closeOnTransactionError(UnknownSource) at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source) at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source) at com.jefco.processors.DataProcessor.process(DataProcessor.java:189) at java.lang.Thread.run(Thread.java:619) Caused by: java.sql.SQLException: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(UnknownSource) ... 13 more Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(UnknownSource) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(UnknownSource) ... 10 more Caused by: java.lang.NullPointerException at org.apache.derby.exe.ac96c5c136x012ex0b13x5d52xffff9ccc25960.e9(Unknown Source) at org.apache.derby.impl.services.reflect.DirectCall.invoke(Unknown Source) at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.doProjection(UnknownSource) at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(UnknownSource) at org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getNextRowFromSource(UnknownSource) at org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getNextRowCore(UnknownSource) at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRow(UnknownSource) ... 5 more Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email, including any attachments, are confidential to the ordinary user of the email address to which it was addressed. If you are not the addressee of this email you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. This email may be produced at the request of regulators or in connection with civil litigation. Jefferies accepts no liability for any errors or omissions arising as a result of transmission. Use by other than intended recipients is prohibited. In the United Kingdom, Jefferies operates as Jefferies International Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Jefferies International Limited is authorised and regulated by the Financial Services Authority. Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email, including any attachments, are confidential to the ordinary user of the email address to which it was addressed. If you are not the addressee of this email you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. This email may be produced at the request of regulators or in connection with civil litigation. Jefferies accepts no liability for any errors or omissions arising as a result of transmission. Use by other than intended recipients is prohibited. In the United Kingdom, Jefferies operates as Jefferies International Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Jefferies International Limited is authorised and regulated by the Financial Services Authority. Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email, including any attachments, are confidential to the ordinary user of the email address to which it was addressed. If you are not the addressee of this email you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. This email may be produced at the request of regulators or in connection with civil litigation. Jefferies accepts no liability for any errors or omissions arising as a result of transmission. Use by other than intended recipients is prohibited. In the United Kingdom, Jefferies operates as Jefferies International Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Jefferies International Limited is authorised and regulated by the Financial Services Authority. --=_alternative 0064AA4A85257832_= Content-Type: text/html; charset="US-ASCII" Hello, Kathey:

thank you for prompt response.

I was running 10.6. Upgraded to 10.7 and encountered the same NPE.

Downgraded to 10.3 and 10.2 but got a different error
        Caused by: java.sql.SQLException: No suitable driver found for jdbc:derby:memory:testdb;create=true

What could be a problem there?


From: Kathey Marsden <kmarsdenderby@sbcglobal.net>
To: Derby Discussion <derby-user@db.apache.org>
Cc: Pavel Bortnovskiy <PBortnovskiy@Jefferies.com>
Date: 02/09/2011 12:45 PM
Subject: Re: NullPointerException deep in Derby





On 2/9/2011 7:49 AM, Pavel Bortnovskiy wrote:
Additional information:

the message "executing statement after shutdown" is misleading. There was no shutdown occurring and the connection was open and valid.


Our query (which I cannot show here for now) was complex, with case statements and group by.

Interestingly, as soon as the query was reworked to remove group by clause, the code worked flawlessly.


P.


Hi Pavel,

Since your problem is in generated code it is hard to figure out what went wrong without more information.
Firstly, I was wondering what version of Derby you are using?  I would suggest  moving to the latest release,  10.7 if you are not already there to see if the problem still exists.  


If it does, run your query with:
derby.debug.true=DumpClassFile and it will dump the generated class file which you can decompile and perhaps get a clue where the problem lies.  I don't think that Derby should ever throw this NPE, so I would say at least file a Jira bug  with the information that you can share and the stack trace.

As a further diagnostic step, there was a major rework and clean up of group by in 10.3,  DERBY-681 which resulted in some regressions. Usually when I see a group by issue, I will first try the build before and after that change to see if it might be related. If you don't want to build Derby, as a first step it would be interesting to see if occurs with 10.3. but not 10.2 to see if DERBY-681 is suspect.  

Thanks

Kathey



From: Pavel Bortnovskiy <PBortnovskiy@Jefferies.com>
To: Derby Discussion <derby-user@db.apache.org>
Date: 02/09/2011 10:43 AM
Subject: NullPointerException deep in Derby






Hello:


I just got the following NullPointerException, seemingly inside Derby code:


2011-02-09 10:39:13,576 ERROR DataProcessor  - SQL Exception due to executing statement after shutdown

java.sql.SQLException: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression.

      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)

      at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)

      at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)

      at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(UnknownSource)

      at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(UnknownSource)

      at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)

      at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)

      at org.apache.derby.impl.jdbc.EmbedResultSet.closeOnTransactionError(UnknownSource)

      at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source)

      at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)

      at com.jefco.processors.DataProcessor.process(DataProcessor.java:189)

      at java.lang.Thread.run(Thread.java:619)

Caused by: java.sql.SQLException: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression.

      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)

      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(UnknownSource)

      ... 13 more

Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.

      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)

      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(UnknownSource)

      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)

      at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)

      at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)

      at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(UnknownSource)

      ... 10 more

Caused by: java.lang.NullPointerException

      at org.apache.derby.exe.ac96c5c136x012ex0b13x5d52xffff9ccc25960.e9(Unknown Source)

      at org.apache.derby.impl.services.reflect.DirectCall.invoke(Unknown Source)

      at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.doProjection(UnknownSource)

      at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(UnknownSource)

      at org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getNextRowFromSource(UnknownSource)

      at org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getNextRowCore(UnknownSource)

      at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRow(UnknownSource)

      ... 5 more




Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email, including any attachments, are confidential to the ordinary user of the email address to which it was addressed. If you are not the addressee of this email you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. This email may be produced at the request of regulators or in connection with civil litigation. Jefferies accepts no liability for any errors or omissions arising as a result of transmission. Use by other than intended recipients is prohibited. In the United Kingdom, Jefferies operates as Jefferies International Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Jefferies International Limited is authorised and regulated by the Financial Services Authority.





Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email, including any attachments, are confidential to the ordinary user of the email address to which it was addressed. If you are not the addressee of this email you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. This email may be produced at the request of regulators or in connection with civil litigation. Jefferies accepts no liability for any errors or omissions arising as a result of transmission. Use by other than intended recipients is prohibited. In the United Kingdom, Jefferies operates as Jefferies International Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Jefferies International Limited is authorised and regulated by the Financial Services Authority.






Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email, including any attachments, are confidential to the ordinary user of the email address to which it was addressed. If you are not the addressee of this email you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. This email may be produced at the request of regulators or in connection with civil litigation. Jefferies accepts no liability for any errors or omissions arising as a result of transmission. Use by other than intended recipients is prohibited. In the United Kingdom, Jefferies operates as Jefferies International Limited; registered in England: no. 1978621; registered office: Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Jefferies International Limited is authorised and regulated by the Financial Services Authority. --=_alternative 0064AA4A85257832_=--