Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D2C70103E3 for ; Wed, 2 Oct 2013 15:32:53 +0000 (UTC) Received: (qmail 77017 invoked by uid 500); 2 Oct 2013 15:32:53 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 75041 invoked by uid 500); 2 Oct 2013 15:32:48 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 74484 invoked by uid 99); 2 Oct 2013 15:32:43 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Oct 2013 15:32:43 +0000 Date: Wed, 2 Oct 2013 15:32:43 +0000 (UTC) From: "Rick Curtis (JIRA)" To: dev@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OPENJPA-2429) NPE was thrown out when a @OrderBy modified column is being persisted. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-2429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13784072#comment-13784072 ] Rick Curtis commented on OPENJPA-2429: -------------------------------------- Can you put together a small unit test that exposes this problem? If that is too onerous, posting snippets of the Entities involved would help recreate the problem. > NPE was thrown out when a @OrderBy modified column is being persisted. > ---------------------------------------------------------------------- > > Key: OPENJPA-2429 > URL: https://issues.apache.org/jira/browse/OPENJPA-2429 > Project: OpenJPA > Issue Type: Bug > Components: datacache > Affects Versions: 2.2.1 > Environment: Windows 7 > WebSphere 8.5 > Reporter: Kymair Wu > > Following NPE was thrown out when a @OrderBy modified column is being persisted. > {quote} > Caused by: java.lang.NullPointerException > at org.apache.openjpa.datacache.DataCachePCDataImpl.clearInverseRelationCache(DataCachePCDataImpl.java:179) > at org.apache.openjpa.datacache.DataCachePCDataImpl.storeField(DataCachePCDataImpl.java:159) > {quote} > I notice that getOrderDeclaration() of FieldMetaData will return null when both _orders and _orderDec are null, which cause the NPE. > The only place _orders will be set after class initialization seems to be getOrders()? But getOrders() is not involved for all the FieldMetaData of "fields[i].getInverseMetaDatas()" > I'm not sure whether this is a OpenJPA issue but whether this NPE should be handled internally? > Google returns a potential case but no more information found. See https://issues.apache.org/jira/browse/OPENJPA-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel and http://mail-archives.apache.org/mod_mbox/openjpa-users/201006.mbox/%3C4C1BE781.9000406@cyberspaceroad.com%3E > Thanks! -- This message was sent by Atlassian JIRA (v6.1#6144)