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

Importing XML at root level using a session from JCA throws a javax.jcr.ItemNotFoundException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.1
    • None
    • jackrabbit-jca, xml
    • None
    • JBoss 4.0.4 Application Server

    Description

      When doing an import of XML I am receiving the following error:
      javax.jcr.ItemNotFoundException: failed to build path of 674a6021-77c7-4975-a26e-b1f56f6a6647: cafebabe-cafe-babe-cafe-babecafebabe has no child entry for 674a6021-77c7-4975-a26e-b1f56f6a6647
      at org.apache.jackrabbit.core.HierarchyManagerImpl.buildPath(HierarchyManagerImpl.java:307)
      at org.apache.jackrabbit.core.CachingHierarchyManager.buildPath(CachingHierarchyManager.java:158)
      at org.apache.jackrabbit.core.HierarchyManagerImpl.getPath(HierarchyManagerImpl.java:356)
      at org.apache.jackrabbit.core.CachingHierarchyManager.getPath(CachingHierarchyManager.java:220)
      at org.apache.jackrabbit.core.BatchedItemOperations.checkRemoveNode(BatchedItemOperations.java:699)
      at org.apache.jackrabbit.core.BatchedItemOperations.recursiveRemoveNodeState(BatchedItemOperations.java:1513)
      at org.apache.jackrabbit.core.BatchedItemOperations.removeNodeState(BatchedItemOperations.java:1215)
      at org.apache.jackrabbit.core.xml.WorkspaceImporter.resolveUUIDConflict(WorkspaceImporter.java:195)
      at org.apache.jackrabbit.core.xml.WorkspaceImporter.startNode(WorkspaceImporter.java:473)
      at org.apache.jackrabbit.core.xml.DocViewImportHandler.startElement(DocViewImportHandler.java:238)
      at org.apache.jackrabbit.core.xml.ImportHandler.startElement(ImportHandler.java:234)
      at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.jackrabbit.core.WorkspaceImpl.importXML(WorkspaceImpl.java:731)
      at com.cc.framework.util.JackrabbitUtil.loadMenuFromXML(JackrabbitUtil.java:158)

      When looking up the meaning behind cafebabe I found that that means the root menu. When I look at the root menu in my repository there is a menu node that has a UUID of what is in the error. Here is the code I am using to do the import:

      Session currentSession = getSession();
      Workspace currentWorkspace = currentSession.getWorkspace();
      String xmlLocation = System.getProperty(CCConstants.REPOSITORY_XML_LOCATION);
      File inputFile = new File(xmlLocation+ "
      menuview.xml");
      FileInputStream in = new FileInputStream(inputFile);

      currentWorkspace.importXML("/", in, ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);

      getSession() is just a static method that retrieves a jackrabbit session from a JNDI lookup that is started using the jackrabbit-jca-1.1.rar. Now when I do this import just in a main method and create the JNDI lookup using the RegistryHelper it works without problem. It only happens when i'm doing the import when using the jca session.

      The xml was obtained by doing an exportDocumentView from /menu. So basically I am just trying to do an import of an xml that was just exported of the same.

      Attachments

        Activity

          People

            Unassigned Unassigned
            pdog Pete Mazur
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: