Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 95984 invoked from network); 12 Mar 2008 14:16:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Mar 2008 14:16:18 -0000 Received: (qmail 81677 invoked by uid 500); 12 Mar 2008 14:16:14 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 81654 invoked by uid 500); 12 Mar 2008 14:16:13 -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 81645 invoked by uid 99); 12 Mar 2008 14:16:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Mar 2008 07:16:13 -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; Wed, 12 Mar 2008 14:15:45 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 446D8234C096 for ; Wed, 12 Mar 2008 07:14:46 -0700 (PDT) Message-ID: <1420220090.1205331286279.JavaMail.jira@brutus> Date: Wed, 12 Mar 2008 07:14:46 -0700 (PDT) From: "Stephane Landelle (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Created: (JCR-1470) NPE in BeanReferenceCollectionConverterImpl on update on empty collection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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: observation Affects Versions: 1.5 Environment: mac os leopard, java5 Reporter: Stephane Landelle 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.