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

Remote SPI connection getNodes() throw NoSuchElementException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4.3
    • None
    • jackrabbit-jcr2spi
    • None
    • Linux

    Description

      With the remote spi connection, it seems that the inner/outer join doesn't work with the result.getNodes() function.

      My code :
      Repository repository = JcrUtils.getRepository(jcrUrl);
      Session session = repository.login( new SimpleCredentials("admin", "admin".toCharArray()));
      String expression = ...;
      QueryManager queryMgr = session.getWorkspace().getQueryManager();
      Query query = queryMgr.createQuery(expression,Query.JCR_SQL2);
      QueryResult result = query.execute();
      Node node = result.getNodes().nextNode();

      Query1 :
      select node.* from [nt:unstructured] as node
      Return one element.

      Query2 :
      select node.* from [nt:unstructured] as node
      left outer join [nt:file] as file on ischildnode(file, node)
      left outer join [nt:resource] as filecontent on ischildnode(filecontent, file)
      Doesn't return any element :
      java.util.NoSuchElementException
      at org.apache.jackrabbit.jcr2spi.query.NodeIteratorImpl.nextNode(NodeIteratorImpl.java:110)

      The second query should return at least one element due to left outer join.

      A solution is to use ( work with both query )
      Node node = result.getRows().nextRow().getNode("node");

      Attachments

        Activity

          People

            Unassigned Unassigned
            elendrim Grégory OLIVER
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: