{"record":{"id":"e3e187394e751ed4","repo":"pentaho/pentaho-kettle","slug":"unable-to-de-serialize-from-xml-for-data-type","errorCode":null,"errorMessage":" : Unable to de-serialize '' from XML for data type ","messagePattern":" : Unable to de-serialize '' from XML for data type ","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java","lineNumber":3453,"sourceCode":"        switch ( getType() ) {\n          case TYPE_STRING:\n            return valueString;\n          case TYPE_NUMBER:\n            return Double.parseDouble( valueString );\n          case TYPE_INTEGER:\n            return Long.parseLong( valueString );\n          case TYPE_DATE:\n            return XMLHandler.stringToDate( valueString );\n          case TYPE_TIMESTAMP:\n            return XMLHandler.stringToTimestamp( valueString );\n          case TYPE_BIGNUMBER:\n            return new BigDecimal( valueString );\n          case TYPE_BOOLEAN:\n            return \"Y\".equalsIgnoreCase( valueString );\n          case TYPE_BINARY:\n            return XMLHandler.stringToBinary( XMLHandler.getTagValue( node, \"binary-value\" ) );\n          default:\n            throw new KettleException( toString() + \" : Unable to de-serialize '\" + valueString\n                + \"' from XML for data type \" + getType() );\n        }\n\n      case STORAGE_TYPE_BINARY_STRING:\n        // Handle binary string content -- only when not NULL\n        // In this case, we opt not to convert anything at all for speed.\n        // That way, we can save on CPU power.\n        // Since the streams can be compressed, volume shouldn't be an issue at\n        // all.\n        //\n        String binaryString = XMLHandler.getTagValue( node, \"binary-string\" );\n        if ( Utils.isEmpty( binaryString ) ) {\n          return null;\n        }\n\n        return XMLHandler.stringToBinary( binaryString );\n\n      case STORAGE_TYPE_INDEXED:","sourceCodeStart":3435,"sourceCodeEnd":3471,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java#L3435-L3471","documentation":"In ValueMetaBase.getValue(node) — XML de-serialization of a value — the stored string is converted back to the declared data type. If the data type is not among the supported types (default branch of the switch), a KettleException is thrown stating the value could not be de-serialized from XML for that data type. It means the XML contains a value of a type the reader cannot reconstruct.","triggerScenarios":"Calling getXML-reading counterparts (getValue/ValueMetaUtil-created metas) on XML produced for a value whose data type falls in the default branch — TYPE_TIMESTAMP, TYPE_INET, TYPE_JSON, TYPE_AVRO or an out-of-range type int read from the node.","commonSituations":"Transformation XML written by a newer Pentaho version (Timestamp/Inet fields) loaded by an older engine; hand-edited XML with an invalid type attribute; plugins with custom types lacking de-serialization support.","solutions":["Use matching Pentaho/Kettle versions on both writer and reader so all types have XML de-serialization support.","Change the field to a supported type (Date instead of Timestamp, String instead of Inet/JSON) and re-export the transformation.","Validate/repair the type attribute in the metadata XML if it was hand-edited or corrupted.","Patch/upgrade the plugin responsible for the custom type to support XML round-tripping."],"exampleFix":"// before\nValueMetaBase vm = new ValueMetaBase(\"host\", ValueMetaInterface.TYPE_INET); // default branch -> KettleException on getValue\n// after\nValueMetaBase vm = new ValueMetaBase(\"host\", ValueMetaInterface.TYPE_STRING);","handlingStrategy":"validation","validationCode":"int[] ok = { TYPE_STRING, TYPE_NUMBER, TYPE_INTEGER, TYPE_DATE, TYPE_BIGNUMBER, TYPE_BOOLEAN, TYPE_BINARY };\nint type = Integer.parseInt(XMLHandler.getTagValue(node, \"type\"));\nif (Arrays.stream(ok).noneMatch(t -> t == type)) {\n  throw new KettleException(\"XML contains unsupported value type \" + type + \"; re-export with matching engine version\");\n}","typeGuard":"boolean isXmlDeserializableType(int type) {\n  return type == ValueMetaInterface.TYPE_STRING\n      || type == ValueMetaInterface.TYPE_NUMBER\n      || type == ValueMetaInterface.TYPE_INTEGER\n      || type == ValueMetaInterface.TYPE_DATE\n      || type == ValueMetaInterface.TYPE_BIGNUMBER\n      || type == ValueMetaInterface.TYPE_BOOLEAN\n      || type == ValueMetaInterface.TYPE_BINARY;\n}","tryCatchPattern":"try {\n  Object value = valueMeta.getValue(node);\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"Unable to de-serialize\")) {\n    throw new KettleException(\"Value type in XML not supported by this engine; upgrade Kettle or convert the field\", e);\n  }\n  throw e;\n}","preventionTips":["Open transformation XML with the same or newer Kettle version that produced it.","Avoid hand-editing the type attribute in metadata XML.","Prefer legacy-supported field types when targeting mixed-version environments."],"tags":["xml","deserialization","unsupported-type","version-mismatch"],"backgroundTag":"unsupported-enum-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"}