Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3050

NullPointerException on removing a node acquired from search result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4.2, 2.5
    • jackrabbit-jcr2spi
    • None

    Description

      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)

      Attachments

        Activity

          People

            stillalex Alex Deparvu
            dbu David Buchmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: