jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Buchmann (Closed) (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (JCR-3050) NullPointerException on removing a node acquired from search result
Date Fri, 03 Feb 2012 15:07:53 GMT

     [ https://issues.apache.org/jira/browse/JCR-3050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

David Buchmann closed JCR-3050.
-------------------------------


oh, ok. guess with the right exception i will understand what i do wrong :-)

actually the root node is reported as something else than nt:unstructured, so it was not so
obvious to me.

thanks for the cleanup
                
> NullPointerException on removing a node acquired from search result
> -------------------------------------------------------------------
>
>                 Key: JCR-3050
>                 URL: https://issues.apache.org/jira/browse/JCR-3050
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jcr2spi
>            Reporter: David Buchmann
>             Fix For: 2.5
>
>
> with a code snipped like the following, i get a NullPointerException in ItemState:
> Session s = repo.login(sc,workspace);
> QueryManager qm = s.getWorkspace().getQueryManager();
> Query q = qm.createQuery("SELECT * FROM [nt:unstructured]", Query.JCR_SQL2);
> QueryResult r = q.execute();
> NodeIterator i = r.getNodes();
> Node n = i.nextNode();
> n.remove(); // breaks here with NullPointerException
> Exception in thread "main" java.lang.NullPointerException                           
                                                                                         
                                                             
>         at org.apache.jackrabbit.jcr2spi.state.ItemState.getParent(ItemState.java:210)
                                                                                         
                                                           
>         at org.apache.jackrabbit.jcr2spi.operation.Remove.create(Remove.java:98)    
                                                                                         
                                                             
>         at org.apache.jackrabbit.jcr2spi.ItemImpl.remove(ItemImpl.java:306) 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message