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

Incorrect exception message when same-name-sibling is prevented on import

    XMLWordPrintableJSON

Details

    Description

      When importing XML for a node with the same name as an existing node, but with different UUID, an ItemExistsException is thrown, effectively preventing the creation of a same-name sibling on import.

      Assuming that same-name siblings are supposed to be prevented on import, that's totally perfect, but the error message of the Exception thrown is wrong and very misleading: "Node with the same UUID exists", where it should be something like "Node with same name exists, must prevent same-name-sibling".

      https://github.com/apache/jackrabbit/blob/b23d6734381e49f236c3705820126803555608b5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java#L381

      As a suggestion, perhaps the code should further check for javax.jcr.nodetype.NodeDefinition#allowsSameNameSiblings before throwing the exception?

      Attachments

        1. SessionImporter.java
          22 kB
          Jörg von Frantzius
        2. DocumentViewTest.java
          12 kB
          Jörg von Frantzius
        3. JCR-4387.diff
          8 kB
          Julian Reschke
        4. JCR-4387.diff
          8 kB
          Julian Reschke

        Activity

          People

            reschke Julian Reschke
            jfrantzius Jörg von Frantzius
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: