{"record":{"id":"54f27910c8db9b17","repo":"pentaho/pentaho-kettle","slug":"unable-to-serialize-data-type-to-xml","errorCode":null,"errorMessage":" : Unable to serialize data type to XML ","messagePattern":" : Unable to serialize data type to XML ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java","lineNumber":3372,"sourceCode":"                string = XMLHandler.date2string( (Date) object );\n                break;\n              case TYPE_BIGNUMBER:\n                string = ( (BigDecimal) object ).toString();\n                break;\n              case TYPE_BOOLEAN:\n                string = Boolean.toString( (Boolean) object );\n                break;\n              case TYPE_BINARY:\n                string = XMLHandler.encodeBinaryData( (byte[]) object );\n                break;\n              case TYPE_TIMESTAMP:\n                string = XMLHandler.timestamp2string( (Timestamp)  object );\n                break;\n              case TYPE_INET:\n                string = ( (InetAddress) object ).toString();\n                break;\n              default:\n                throw new IOException( toString() + \" : Unable to serialize data type to XML \" + getType() );\n            }\n\n            break;\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\n            // at all.\n            //\n            string = XMLHandler.addTagValue( \"binary-string\", (byte[]) object );\n            xml.append( XMLHandler.openTag( XML_DATA_TAG ) ).append( string ).append( XMLHandler.closeTag( XML_DATA_TAG ) );\n            return xml.toString();\n\n          case STORAGE_TYPE_INDEXED:\n            // Just an index\n            string = XMLHandler.addTagValue( \"index-value\", (Integer) object );","sourceCodeStart":3354,"sourceCodeEnd":3390,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java#L3354-L3390","documentation":"In ValueMetaBase.getXML (data of storage type NORMAL), the object's data type is mapped to an XML string via a switch. If the data type is not among the supported XML-serializable types (it hits the default branch), an IOException is thrown with this message. It means this value's type has no defined XML representation.","triggerScenarios":"Calling getMetaXML()/getXML() on a value meta whose data type is TYPE_TIMESTAMP, TYPE_INET, TYPE_JSON, TYPE_AVRO or another type in the switch's default branch while storage type is NORMAL (code path where newer types were expected to be handled upstream).","commonSituations":"A transformation built in a newer Pentaho version (containing Timestamp/Inet fields) opened with an older engine version; custom/3rd-party plugins defining types the core XML writer does not know; corrupted metadata where the type int is out of range.","solutions":["Align Kettle/Pentaho versions so both designer and runtime support the value type's XML serialization.","Change the field to a supported type (e.g. use Date instead of Timestamp, String instead of Inet) before serializing.","If a plugin introduced the type, upgrade or patch the plugin to provide XML serialization support.","Validate the metadata XML/file for a corrupted type value and regenerate it."],"exampleFix":"// before\nValueMetaBase vm = new ValueMetaBase(\"when\", ValueMetaInterface.TYPE_TIMESTAMP); // hits default branch\n// after\nValueMetaBase vm = new ValueMetaBase(\"when\", ValueMetaInterface.TYPE_DATE);","handlingStrategy":"validation","validationCode":"int[] ok = { TYPE_STRING, TYPE_NUMBER, TYPE_INTEGER, TYPE_DATE, TYPE_BIGNUMBER, TYPE_BOOLEAN, TYPE_BINARY, TYPE_TIMESTAMP, TYPE_INET /* if engine supports */ };\nif (vm.getStorageType() == STORAGE_TYPE_NORMAL\n    && Arrays.stream(ok).noneMatch(t -> t == vm.getType())) {\n  vm.setType(TYPE_STRING); // normalize unsupported types before export\n}","typeGuard":"boolean hasXmlSerializableType(ValueMetaInterface vm) {\n  return vm.getType() == ValueMetaInterface.TYPE_STRING\n      || vm.getType() == ValueMetaInterface.TYPE_NUMBER\n      || vm.getType() == ValueMetaInterface.TYPE_INTEGER\n      || vm.getType() == ValueMetaInterface.TYPE_DATE\n      || vm.getType() == ValueMetaInterface.TYPE_BIGNUMBER\n      || vm.getType() == ValueMetaInterface.TYPE_BOOLEAN\n      || vm.getType() == ValueMetaInterface.TYPE_BINARY;\n}","tryCatchPattern":"try {\n  String xml = valueMeta.getXML();\n} catch (IOException e) {\n  if (e.getMessage().contains(\"Unable to serialize data type to XML\")) {\n    throw new KettleException(\"Field '\" + valueMeta.getName() + \"' type \" + valueMeta.getTypeDesc()\n        + \" is not supported by this engine version; upgrade or convert the field\", e);\n  }\n  throw e;\n}","preventionTips":["Keep Pentaho designer and runtime on identical versions.","Convert newer types (Timestamp, Inet, Json) to legacy types before exporting to older engines.","Run a smoke-test export of all transformations after version upgrades."],"tags":["xml","serialization","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"}