Importing library content fails with error "com.spotfire.ws.library.StorageException, ILLEGAL_ARGUMENT, The item cannot be parent of itself"

Importing library content fails with error "com.spotfire.ws.library.StorageException, ILLEGAL_ARGUMENT, The item cannot be parent of itself"

book

Article ID: KB0081760

calendar_today

Updated On:

Products Versions
Spotfire Analyst 7.5,7.6,7.7,7.8,7.9,7.10,7.11,7.12

Description

It is common to export dashboards from Development and then import them to the Production Spotfire environment which in Spotfire terms is called Library export/import.

Library import can fail when trying to perform an import in the same folder structure hierarchy as it is exported.

Consider this hierarchy in the Spotfire library-
  /
    Folder1
       Folder2 
           Mydxp

Assume this folder structure and dxp exists in both Dev and Production environments and now you would want to export the updated Mydxp from Dev and import it in a Production Spotfire environment.

For this you would export Folder1 from the Spotfire Library say 'Test1.zip'.The export would contain Folder1-Folder2-Mydxp.

The next step is to import Test1.zip in the Production Spotfire environment. As the folder hierarchy already exists in Production ,the import needs to be performed using the 'Replace existing item' option .The import is initiated and the destination folder to import to is set as 'Folder1'.

Spotfire will start importing and then fail with an error -


com.spotfire.ws.library.StorageException: ILLEGAL_ARGUMENT, The item cannot be parent of itself

This error will be logged in the {Spotfireserverinstall}/tomcat/logs/impex.log

  



 

Resolution

The above error is thrown as the import is being performed into an existing directory resulting in a circular reference in the library i.e 'Folder1' trying to import onto itself and is the reason for this failure.

If there is a need to import with 'Replace existing item' option set and the Folder hierarchy already exists, the destination folder needs to be set to the root level ie "/" . This can help bypassing the circular reference and results in a successful library import.

Issue/Introduction

This article describes the condition under which library import can fail with the error "The-item-cannot-be-parent-of-itself"