Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 10312 invoked from network); 16 Sep 2008 14:17:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Sep 2008 14:17:38 -0000 Received: (qmail 8923 invoked by uid 500); 16 Sep 2008 14:17:32 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 8886 invoked by uid 500); 16 Sep 2008 14:17:32 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 8830 invoked by uid 99); 16 Sep 2008 14:17:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 07:17:32 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 14:16:42 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 81743234C1DD for ; Tue, 16 Sep 2008 07:16:44 -0700 (PDT) Message-ID: <1296388073.1221574604529.JavaMail.jira@brutus> Date: Tue, 16 Sep 2008 07:16:44 -0700 (PDT) From: "Jukka Zitting (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Reopened: (JCR-1470) NPE in BeanReferenceCollectionConverterImpl on update on empty collection In-Reply-To: <1420220090.1205331286279.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/JCR-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jukka Zitting reopened JCR-1470: -------------------------------- Reopening to change resolution from Fixed to Cannot Reproduce. > NPE in BeanReferenceCollectionConverterImpl on update on empty collection > ------------------------------------------------------------------------- > > Key: JCR-1470 > URL: https://issues.apache.org/jira/browse/JCR-1470 > Project: Jackrabbit > Issue Type: Bug > Components: jackrabbit-ocm > Affects Versions: 1.5 > Environment: mac os leopard, java5 > Reporter: Stephane Landelle > Assignee: Christophe Lombart > > use case : > in the same transaction : > *) retrieve an object that has a collection of references, yet empty > *) add an element in the collection > *) update the object > consequence : > org.apache.jackrabbit.ocm.exception.ObjectContentManagerException: Cannot insert collection field : authors of class com.weka.content.api.model.Folder; nested exception is java.lang.NullPointerException: null > java.lang.NullPointerException > at org.apache.jackrabbit.ocm.manager.collectionconverter.impl.ManageableArrayList$$EnhancerByCGLIB$$8f15dde4.getSize() > at org.apache.jackrabbit.ocm.manager.collectionconverter.impl.BeanReferenceCollectionConverterImpl.addUuidProperties(BeanReferenceCollectionConverterImpl.java:154) > at org.apache.jackrabbit.ocm.manager.collectionconverter.impl.BeanReferenceCollectionConverterImpl.doUpdateCollection(BeanReferenceCollectionConverterImpl.java:101) > The failing line is in addUuidProperties : > Value[] values = new Value[collection.getSize()]; > It seems the CGlib enhanced collection fails and needs to be initialized before. > For example, in doUpdateCollection, if I code : > // Delete existing values > if (parentNode.hasProperty(jcrName)) { > parentNode.setProperty(jcrName, (Value[]) null); > } > > if (collection != null) { > collection.getSize(); <<<<<< > } > I get a NPE on collection.getSize(); > but if I code : > if (collection != null) { > collection.getSize(); > } > // Delete existing values > if (parentNode.hasProperty(jcrName)) { > parentNode.setProperty(jcrName, (Value[]) null); > } > everything runs fine?! -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.