nasa / CCDD

CFS Command and Data Dictionary Tool (CCDDT)
81 stars 31 forks source link

Error when exporting XTCE files from command line #101

Closed Vysares closed 1 year ago

Vysares commented 1 year ago

When attempting to export XTCE files from the command line, the following error occurs:

CCDD : CCDD Error : An unanticipated error occurred; cause 'java.lang.String cannot be cast to CCDD.CcddConstants$EndianType'  Error trace:   CcddXTCEHandler: exportTables() line 2656   CcddFileIOHandler: exportSelectedTables() line 3748   CcddCommandLineHandler: doCommand() line 1665   CcddCommandLineHandlerCommandHandler: handler() line 391   CcddCommandLineHandler: parseCommand() line 2795   CcddCommandLineHandler: parseCommand() line 2690   CcddMain: parseDbSpecificCommandLineCommands() line 978   CcddDbControlHandler: openDatabase() line 2760   CcddDbControlHandler: openDatabase() line 2516   CcddDbControlHandler: openDatabase() line 2500   CcddMain: () line 422   CcddMain: run() line 450

This is the command that generates the above error: $ java -jar CCDD.jar -project myproject -host localHost -user ccdduser -password ccdd -export "-format xtce -tablepaths test_table -filepath test_xtce_output -version 1.0" -shutdown

This seems to only occur for XTCE format, and not when exporting csv or json files. Exporting from the GUI presents no issues.

KevinMcCluney commented 1 year ago

Two endianess parameters (endianess and isHeaderBigEndian) are missing in CcddFileHandler.java for the call to ioHandler.exportTables() starting in line 3748. The call should look like:

      ioHandler.exportTables(file,
                             singleDef,
                             includeBuildInformation,
                             replaceMacros,
                             includeVariablePaths,
                             variableHandler,
                             separators,
                             outputType,
                             endianess,
                             isHeaderBigEndian,
                             version,
                             validationStatus,
                             classification1,
                             classification2,
                             classification3);

This will be corrected in the next version. I uploaded a beta version with this fix: CCDD_beta.jar.