7 Replies Latest reply on Jul 21, 2010 4:32 PM by Kurt Stam

    Cloning and ItemExistsException Question

    Kurt Stam Master

      Hi guys,

       

      When I clone an item in a workspace to a different destination then its source, then I am not expecting a ItemExistsException, but I am getting:

       

      javax.jcr.ItemExistsException: A node with UUID "65b5f638-a452-4d14-906c-7f88d9303721" already exists at path "/ns001:repository/ns001:package_area/globalArea/assets/testAddRuleItemFromGlobalAreaRuleItem" in workspace ""

       

      when executing: workspace.clone(workspace.getName(), globalAssetItem.getNode().getPath(), path, false);

       

      The value of 'path' is:

       

      /drools:repository/drools:package_area/testAddRuleItemFromGlobalArea1/assets/testAddRuleItemFromGlobalAreaRuleItem

       

      which is different from the srcPath, which is the path mentioned in the exception.

       

      What am I doing wrong here, or is this a bug? I'm using ModeShape 2.0.0.Final.

       

      Thx,

       

      --Kurt

       

      for the complete source code see the 'addAssetImportedFromGlobalArea' test:

      http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-repository/src/test/java/org/drools/repository/PackageItemTest.java