{"record":{"id":"23b209933892b4d0","repo":"pentaho/pentaho-kettle","slug":"e-wrapped-exception-getxmldatameta","errorCode":null,"errorMessage":"e (wrapped exception)","messagePattern":"e \\(wrapped exception\\)","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLDataMeta.java","lineNumber":946,"sourceCode":"    for ( i = 0; i < inputFields.length; i++ ) {\n      GetXMLDataField field = inputFields[i];\n\n      int type = field.getType();\n      if ( type == ValueMeta.TYPE_NONE ) {\n        type = ValueMeta.TYPE_STRING;\n      }\n      try {\n        ValueMetaInterface v = ValueMetaFactory.createValueMeta( space.environmentSubstitute( field.getName() ), type );\n        v.setLength( field.getLength() );\n        v.setPrecision( field.getPrecision() );\n        v.setOrigin( name );\n        v.setConversionMask( field.getFormat() );\n        v.setDecimalSymbol( field.getDecimalSymbol() );\n        v.setGroupingSymbol( field.getGroupSymbol() );\n        v.setCurrencySymbol( field.getCurrencySymbol() );\n        r.addValueMeta( v );\n      } catch ( Exception e ) {\n        throw new KettleStepException( e );\n      }\n    }\n\n    if ( includeFilename ) {\n      ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( filenameField ), ValueMeta.TYPE_STRING );\n      v.setLength( 250 );\n      v.setPrecision( -1 );\n      v.setOrigin( name );\n      r.addValueMeta( v );\n    }\n\n    if ( includeRowNumber ) {\n      ValueMetaInterface v = new ValueMeta( space.environmentSubstitute( rowNumberField ), ValueMeta.TYPE_INTEGER );\n      v.setLength( ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0 );\n      v.setOrigin( name );\n      r.addValueMeta( v );\n    }\n    // Add additional fields","sourceCodeStart":928,"sourceCodeEnd":964,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLDataMeta.java#L928-L964","documentation":"In getFields (StepMetaInterface), while converting each configured XML field into a ValueMeta (applying format, decimal/grouping/currency symbols), any exception is wrapped in a KettleStepException with the original exception as the sole cause. It signals a bad field definition (usually an invalid format mask).","triggerScenarios":"GetXMLDataMeta.getFields loop: new ValueMeta(...)/setConversionMask/setDecimalSymbol or r.addValueMeta throws while building the output row layout for a field whose Format/Length/Precision is invalid.","commonSituations":"Invalid or locale-inconsistent number/date format masks entered in the Fields tab, copy-pasted masks from other locales, empty format strings on typed fields.","solutions":["Inspect the chained cause to identify the offending field; check its Format mask in the Fields tab.","Fix or clear the Format value (e.g. use a valid SimpleDateFormat/DecimalFormat pattern for the runtime locale).","Test the step in isolation and preview data to confirm the corrected mask parses sample values.","If the field is a string anyway, set its type to String and drop the conversion mask."],"exampleFix":"// before\nfield.setFormat( \"YYYY-MM-DD\" ); // DecimalFormat-style caps, wrong for java.text.SimpleDateFormat\n// after\nfield.setFormat( \"yyyy-MM-dd\" );","handlingStrategy":"validation","validationCode":"// Validate a date format mask before configuring the field\nnew SimpleDateFormat( \"yyyy-MM-dd\" ); // throws IllegalArgumentException on invalid mask","typeGuard":null,"tryCatchPattern":"try { stepMeta.getFields( rowMeta, origin, null, null, space, null ); } catch ( KettleStepException e ) { log.error( \"Bad field definition: \" + e.getCause(), e ); }","preventionTips":["Test Format masks on sample values in Spoon's preview before saving.","Use java.text.SimpleDateFormat/DecimalFormat-compatible patterns.","Prefer String type with no mask when no conversion is actually needed."],"tags":["pentaho-kettle","metadata","value-format","getxmldata"],"backgroundTag":"invalid-config-value","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}