Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 64197 invoked from network); 26 Apr 2007 19:51:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Apr 2007 19:51:12 -0000 Received: (qmail 61359 invoked by uid 500); 26 Apr 2007 19:51:18 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 61331 invoked by uid 500); 26 Apr 2007 19:51:18 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 61318 invoked by uid 99); 26 Apr 2007 19:51:18 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 12:51:18 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of plinskey@bea.com designates 66.248.192.39 as permitted sender) Received: from [66.248.192.39] (HELO repmmg02.bea.com) (66.248.192.39) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 12:51:09 -0700 Received: from repmmr01.bea.com (repmmr01.bea.com [10.160.29.71]) by repmmg02.bea.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id l3QJolKi005027 for ; Thu, 26 Apr 2007 12:50:47 -0700 Received: from repbex02.amer.bea.com (repbex02.bea.com [10.160.26.99]) by repmmr01.bea.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id l3QJokDq006161 for ; Thu, 26 Apr 2007 12:50:46 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: RE: How to debug object retrieveal in JPA? Date: Thu, 26 Apr 2007 12:50:06 -0700 Message-ID: <7D856CDFE035FF45A0420ACBD71BDD630401BCD2@repbex02.amer.bea.com> In-Reply-To: <00ff01c7883a$984778d0$6601a8c0@tyan2400> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to debug object retrieveal in JPA? Thread-Index: AceICrKNTivUCsx/R2eMyTajHFj+wwAH6HqwAAIrN6AAAjchoA== References: <00cf01c7882a$94a73ae0$6601a8c0@tyan2400> <00ff01c7883a$984778d0$6601a8c0@tyan2400> From: "Patrick Linskey" To: x-BEA-PMX-Instructions: AV x-BEA-MM: Internal-To-External X-Virus-Checked: Checked by ClamAV on apache.org Could you post the full NPE? Is results null, or is the NPE coming from within OpenJPA somewhere? OpenJPA shouldn't be returning a null collection in any situation, I don't think. One way to fish for causes of suspicious problems is to set the default log level to TRACE: This will generate tons of output, but the stuff towards the end might provide something of value. -Patrick -- Patrick Linskey BEA Systems, Inc. _______________________________________________________________________ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. > -----Original Message----- > From: Phill Moran [mailto:pjmoran@rogers.com] > Sent: Thursday, April 26, 2007 12:39 PM > To: open-jpa-dev@incubator.apache.org > Subject: How to debug object retrieveal in JPA? > > Community, > > How does one go about debugging object retrieval/creation. I > continue to have exceptions and little to go on as far as the cause. > The named JPQL is good since I know it generates a good sql > (can trace code and see it) . I know the sql is good as I can > copy/paste it into mysql query browser, execute and get the > correct data back. The problem is that these lines result in an NPE. > > Query q = > this.getEntityManager().createNamedQuery("PersonFXStoreAndLogin"); > q.setParameter("storeName", storeName.toUpperCase()); > q.setParameter("loginName", loginName.toUpperCase()); > List results = null; > try { > results = (List) q.getResultList(); > System.out.println(results.size()); > } > catch(Exception e) { > e.printStackTrace(); > } > if (results.isEmpty()) { <- NPE thrown here > throw new UserNotFoundException("No > user found"); > } > Also the "mappingTool validate" seems to work fine. Of course > how would I know since I can find no description of what a > good one looks like but reading it (no > exceptions) seem to make sense. > > Any help would be much appreciated. > > Phill > > Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.