/
NullPointerException when converting MettleCI Unit Test Specifications

NullPointerException when converting MettleCI Unit Test Specifications

Problem 1

When attempting to perform a S2PX conversion you receive an error.

Symptom 1

You receive an error Exception in thread "main" java.lang.NullPointerException. e.g.,

$ mettleci s2px convert \ -config customRoutine-zodiac.yaml \ -source-dsx animalZodiacJobAndRoutines.dsx -target-dsx target-dsx/zodiac.dsx \ -source-specs /opt/dm/mci/specs/AnimalZodiac/ \ -target-specs target-specs/ MettleCI Command Line (build 161) (C) 2018-2022 Data Migrators Pty Ltd Loading configuration Preprocessing 'animalZodiacJobAndRoutines.dsx' Converting jobs Decomposing AnimalZodiac Translating AnimalZodiacPx Exception in thread "main" java.lang.NullPointerException at java.io.File.<init>(File.java:362) at com.datamigrators.mettle.svpx.translation.UnitTestConverter.convertSpec(UnitTestConverter.java:132) at com.datamigrators.mettle.svpx.translation.UnitTestConverter.convertUnitTest(UnitTestConverter.java:118) at com.datamigrators.mettle.svpx.translation.UnitTestConverter.convert(UnitTestConverter.java:60) <etc.>

Solution 1

MettleCI assumes you are passing fully qualified -source-specs and -target-specs directories during conversion, and makes assumptions about the structure based on what MettleCI Workbench produces. In the example above you should use a path of the following form:

-target-specs /opt/dm/mci/specs/target-specs/

Problem 2

Symptom 2

You receive Problem an error seemingly related to the conversion of the Aggregator Stage. e.g.,

Unexpected error 'e2d2a70e61661858' occurred java.lang.NullPointerException at com.datamigrators.mettle.svpx.translation.operations.AggregatorTranslation.translateStage(AggregatorTranslation.java:65) at com.datamigrators.mettle.svpx.translation.operations.AbstractStageTranslation.processTranslationStages(AbstractStageTranslation.java:60) at com.datamigrators.mettle.svpx.translation.operations.AbstractStageTranslation.translateRootContainer(AbstractStageTranslation.java:41) <etc.>

Solution 2

You can receive this message if you’re using a version of the MettleCI Command Line prior to version 1.1-128 which is the minimum level required to support S2PX. Please see the S2PX prerequisites documentation for details.

Related content

S2PX Prerequisites
More like this
Protecting sensitive information used in Azure DevOps Pipelines
Protecting sensitive information used in Azure DevOps Pipelines
Read with this
Executing S2PX Conversion
Executing S2PX Conversion
More like this
MettleCI CLI produces error 'Incorrectly typed data found for annotation element'
MettleCI CLI produces error 'Incorrectly typed data found for annotation element'
More like this
Running Unit Test Interception produces an error 'Can not deserialize'
Running Unit Test Interception produces an error 'Can not deserialize'
More like this
UnitTest Migrate Command
UnitTest Migrate Command
More like this

© 2015-2024 Data Migrators Pty Ltd.