jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephane Landelle (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1470) NPE in BeanReferenceCollectionConverterImpl on update on empty collection
Date Fri, 23 May 2008 12:55:56 GMT

    [ https://issues.apache.org/jira/browse/JCR-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599354#action_12599354
] 

Stephane Landelle commented on JCR-1470:
----------------------------------------

I can no longer reproduce it either. It might have been corrected somehow...
Please consider this case closed.

Sincerely,

St├ęphane Landelle




> 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(<generated>)
> 	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.


Mime
View raw message