Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 10506 invoked from network); 20 Aug 2007 23:19:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Aug 2007 23:19:55 -0000 Received: (qmail 35742 invoked by uid 500); 20 Aug 2007 23:19:52 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 35560 invoked by uid 500); 20 Aug 2007 23:19:52 -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 35542 invoked by uid 99); 20 Aug 2007 23:19:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2007 16:19:51 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2007 23:20:24 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 03DFD71420D for ; Mon, 20 Aug 2007 16:19:31 -0700 (PDT) Message-ID: <22741498.1187651971013.JavaMail.jira@brutus> Date: Mon, 20 Aug 2007 16:19:31 -0700 (PDT) From: "Patrick Linskey (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Resolved: (OPENJPA-314) Unenhanced complex id in MappedSuperclass causes NPE In-Reply-To: <22450657.1187112930346.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Patrick Linskey resolved OPENJPA-314. ------------------------------------- Resolution: Fixed > Unenhanced complex id in MappedSuperclass causes NPE > ---------------------------------------------------- > > Key: OPENJPA-314 > URL: https://issues.apache.org/jira/browse/OPENJPA-314 > Project: OpenJPA > Issue Type: Bug > Components: jpa > Reporter: Dain Sundstrom > Fix For: 1.0.0 > > Attachments: OPENJPA-314.patch > > > When I have a complex id within an unenhanced MappedSuperClass, I get a NPE when calling persist. The NPE appears to be caused because ClassMetaData.getField(int) does not take unenhanced MappedSuperclass fields into account. Here is the stack trace: > org.apache.openjpa.persistence.PersistenceException: null > at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2437) > at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2251) > at org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1010) > at org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:541) > at org.apache.openjpa.enhance.TestUnenhancedCompoundPKSubclass.compoundPKHelper(TestUnenhancedCompoundPKSubclass.java:46) > at org.apache.openjpa.enhance.TestUnenhancedCompoundPKSubclass.testCompoundPKFieldAccessUserDefined(TestUnenhancedCompoundPKSubclass.java:35) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) > Caused by: java.lang.NullPointerException > at org.apache.openjpa.util.ApplicationIds$PrimaryKeyFieldManager.retrieve(ApplicationIds.java:568) > at org.apache.openjpa.util.ApplicationIds$PrimaryKeyFieldManager.fetchIntField(ApplicationIds.java:537) > at org.apache.openjpa.enhance.org$apache$openjpa$enhance$UnenhancedCompoundPKFieldAccessSubclass$pcsubclass.pcCopyKeyFieldsToObjectId(Unknown Source) > at org.apache.openjpa.enhance.PCRegistry.copyKeyFieldsToObjectId(PCRegistry.java:160) > at org.apache.openjpa.util.ApplicationIds.fromPKValues(ApplicationIds.java:185) > at org.apache.openjpa.enhance.ReflectingPersistenceCapable.pcNewObjectIdInstance(ReflectingPersistenceCapable.java:257) > at org.apache.openjpa.util.ApplicationIds.create(ApplicationIds.java:384) > at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2405) > ... 23 more > Attached is a test case that reproduces the NPE. The test methods have been disabled as to not break the build. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.