Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-2603

incorrect error and errormessage when calling jcr addNode

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Cannot Reproduce
    • r2.06.03 (m13 - rc4)
    • r2.06.06 (m13 - rc7), r2.07.00
    • None
    • None

    Description

      We use the content-importer of the CMS to import content from CMS 6 into the CMS 7 repository.
      The CMS 6 content is available to us as a file tree of XML documents.
      We wrote Java classes for importing the XML documents into hippo:document JCR nodes according to document types that are defined for our project. Our Java classes work within the 'framework' supplied by the content-importer.

      The import of the particular file tree has been done before with CMS 2.3.3. Everything worked fine.

      Now, with CMS 2.6.0, on some files, PathNotFoundExceptions are thrown while trying to add a hippo:facetselect. As a result, the document is skipped by the content-importer tool. As a further result, shortly after that, the import process crashes on a constraint violation, because the mandatory property docbase does not exist.

      The code throwing the PathNotFoundException is:

      this.target = parent.addNode(encodedname, NodeType);

      The document Jubileum was chosen for the tests. In the Jubileum document, the parameter encodedname had value 'De-pragmaticus'. NodeType = hippo:facetselect and the parent node is duitslandweb:body' of nodetype 'hippostd:html.

      The PathNotFoundException states the following: A javax.jcr.PathNotFoundException is thrown: Unable to find path: /content/documents/duitslandweb/agenda/activiteiten/2006/11/Jubileum/Jubileum/duitslandweb:body/De-pragmaticus.

      However, that path is actually valid. I checked this by catching the exception and check on the path of the parent. This is /content/documents/duitslandweb/agenda/activiteiten/2006/11/Jubileum/Jubileum/duitslandweb:body.

      Furthermore, the node 'De-pragmaticus' is actually created by the code throwing the exception. I mention this, because I expect that if a path is not found, it should not be possible to create a node there. I tested whether the node was actually created by the code throwing the exception. I did this by checking on the existence of the node before and after that code.

      The crash on the constraint violation can now be explained: the faceselect node is actually created, but the Jubileum document is skipped because of the thrown exception, which causes the docbase not to be added.

      The described PathNotFoundException only occurs if there is already a hippo:document of the same name as the one to be imported and the old one does not have the facetselect.
      If the content-importer finds a hippo:document of the same name as the one to be created, it removes that existing one by
      the remove() method. Then the new 'version' is created.

      A short path to get the PathNotFoundException is:

      • I start with a repository that does not contain the Jubileum hippo:document.
      • I import the Jubileum XML document.
      • The Jubileum hippo:document is successfully created.
      • I remove the facetselect from it.
      • I again try to import the Jubileum XML document.
      • The PathNotFoundException is thrown and the constraint violation crash occurs.

      I found a workaround:
      I do a save() on the folder that contains the Jubileum hippo:document, before I add the facetselect.
      Now, the PathNotFoundException never occurs. Not on the Jubileum document and not on any other document
      that had caused the exception.

      Attachments

        1. after-cms-console-login.log
          13 kB
          Rita Bijlsma
        2. after-delete-facetselect.log
          14 kB
          Rita Bijlsma
        3. after-import-plain.log
          0.1 kB
          Rita Bijlsma
        4. after-overwrite.log
          14 kB
          Rita Bijlsma
        5. after-startup-jetty.log
          0.1 kB
          Rita Bijlsma
        6. import-overwrite.log
          24 kB
          Rita Bijlsma
        7. import-plain.log
          20 kB
          Rita Bijlsma
        8. Jubileum.xml
          2 kB
          Rita Bijlsma
        9. Jubileum.xml.meta.xml
          2 kB
          Rita Bijlsma

        Activity

          People

            bvdschans Bart van der Schans (Inactive)
            rbijlsma Rita Bijlsma (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: