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

ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING and ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING not working over davex

    XMLWordPrintableJSON

Details

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

    Description

      i have a repository with a node like this:

      <sv:node sv:name="idExample">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>nt:unstructured</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:mixinTypes" sv:type="Name">
      <sv:value>mix:referenceable</sv:value>
      </sv:property>
      <sv:property sv:name="jcr:uuid" sv:type="String">
      <sv:value>842e61c0-09ab-42a9-87c0-308ccc90e6f4</sv:value>
      </sv:property>
      </sv:node>

      when i try to import that node a second time at a different location, i only get things to work with ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW. the COLLISION_THROW throws an exception as expected. but when telling to replace or remove the existing node, i get

      Exception in thread "main" javax.jcr.RepositoryException: javax.jcr.ItemExistsException: a node with uuid 842e61c0-09ab-42a9-87c0-308ccc90e6f4 already exists!
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:69)
      at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51)
      at org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(RepositoryServiceImpl.java:611)
      at org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.access$600(RepositoryServiceImpl.java:547)
      at org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.submit(RepositoryServiceImpl.java:452)
      at org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.execute(WorkspaceManager.java:858)
      at org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.access$500(WorkspaceManager.java:817)
      at org.apache.jackrabbit.jcr2spi.WorkspaceManager.execute(WorkspaceManager.java:620)
      at org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.save(SessionItemStateManager.java:139)
      at org.apache.jackrabbit.jcr2spi.ItemImpl.save(ItemImpl.java:250)
      at org.apache.jackrabbit.jcr2spi.SessionImpl.save(SessionImpl.java:333)
      at Client.main(Client.java:31)

      my code is dead simple. init jackrabbit over davex, then

      session.importXML("/path", new FileInputStream("base.xml"), ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);

      jackrabbit actually tries to send something over the wire:

      -/idExample :
      +/idExample :

      {"jcr:primaryType":"nt:file","jcr:uuid":"842e61c0-09ab-42a9-87c0-308ccc90e6f4"}

      ^/idExample/jcr:mixinTypes : []
      +/idExample/jcr:content :

      {"jcr:primaryType":"nt:unstructured"}

      i wonder if the jsop implementation on server side is broken or if i misunderstand something.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dbu David Buchmann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: