Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-1977

CSV importer fails with an IllegalArgumentException if the CSV file contains blank trailing columns/rows

    XMLWordPrintable

Details

    Description

      If the CSV file contains blank rows/columns, the import fails with the following exception:

      Cause :
      java.lang.IllegalArgumentException: username argument cannot be null or blank

      Stack Trace :

      java.lang.IllegalArgumentException: username argument cannot be null or blank
      at org.apache.commons.lang.Validate.isTrue(Validate.java:157)
      at com.atlassian.crowd.integration.model.user.UserTemplate.<init>(UserTemplate.java:35)
      at com.atlassian.crowd.integration.model.user.UserTemplateWithAttributes.<init>(UserTemplateWithAttributes.java:11)
      at com.atlassian.crowd.integration.model.user.UserTemplateWithCredentialAndAttributes.<init>(UserTemplateWithCredentialAndAttributes.java:24)
      at com.atlassian.crowd.importer.mappers.csv.UserMapper.mapRow(UserMapper.java:49)
      at com.atlassian.crowd.importer.importers.CsvImporter.findUsers(CsvImporter.java:190)
      at com.atlassian.crowd.importer.importers.BaseImporter.importUsersGroupsAndMemberships(BaseImporter.java:195)
      at com.atlassian.crowd.importer.manager.ImporterManagerImpl.performImport(ImporterManagerImpl.java:35)
      at com.atlassian.crowd.console.action.dataimport.CsvConfirmation.doExecute(CsvConfirmation.java:39)

      It would be helpful to have the trailing blank rows/columns to be stripped off prior to importing the content or catching the exception and reporting a more meaningful error.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ganand Gurleen Anand [Atlassian]
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: