{"record":{"id":"e0cecf1b957a5601","repo":"pentaho/pentaho-kettle","slug":"resourceutil-exception-errorserializingexportinterface","errorCode":"ResourceUtil.Exception.ErrorSerializingExportInterface","errorMessage":"ResourceUtil.Exception.ErrorSerializingExportInterface","messagePattern":"ResourceUtil\\.Exception\\.ErrorSerializingExportInterface","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/resource/ResourceUtil.java","lineNumber":147,"sourceCode":"          ZipEntry zipEntry = new ZipEntry( resourceDefinition.getFilename() );\n\n          String comment =\n            BaseMessages.getString(\n              PKG, \"ResourceUtil.SerializeResourceExportInterface.ZipEntryComment.OriginatingFile\", filename,\n              Const.NVL( resourceDefinition.getOrigin(), \"-\" ) );\n          zipEntry.setComment( comment );\n          out.putNextEntry( zipEntry );\n\n          out.write( resourceDefinition.getContent().getBytes() );\n          out.closeEntry();\n        }\n        String zipURL = fileObject.getName().toString();\n        return new TopLevelResource( topLevelResource, zipURL, \"zip:\" + zipURL + \"!\" + topLevelResource );\n      } else {\n        throw new KettleException( BaseMessages.getString( PKG, \"ResourceUtil.Exception.NoResourcesFoundToExport\" ) );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"ResourceUtil.Exception.ErrorSerializingExportInterface\", resourceExportInterface.toString() ), e );\n    } finally {\n      if ( out != null ) {\n        try {\n          out.close();\n        } catch ( IOException e ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"ResourceUtil.Exception.ErrorClosingZipStream\", zipFilename ) );\n        }\n      }\n    }\n  }\n\n  public static String getExplanation( String zipFilename, String launchFile,\n    ResourceExportInterface resourceExportInterface ) {\n\n    String commandString = \"\";\n    if ( Const.isWindows() ) {","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/resource/ResourceUtil.java#L129-L165","documentation":"Catch-all wrapper in serializeResourceExportInterface: any exception while writing resources into the export zip (creating the zip file, writing entries, building TopLevelResource) is re-thrown as a KettleException keyed ResourceUtil.Exception.ErrorSerializingExportInterface, with the original exception attached as cause.","triggerScenarios":"IOException creating or writing the zip file (bad zipFilename path, disk full, permissions), VFS errors resolving resource file objects, or content write failures during the export loop.","commonSituations":"Export directory not writable or nonexistent; referenced resource files missing/unreadable at export time; invalid characters in the zip filename; disk quota exceeded on the export volume.","solutions":["Read e.getCause() for the underlying IO/VFS error and fix it","Ensure the target directory for zipFilename exists and is writable","Verify all referenced resource files exist and are readable before exporting","Check free disk space and filename validity (no illegal characters)"],"exampleFix":"// before\nTopLevelResource res = ResourceUtil.serializeResourceExportInterface(zipFilename, exportable, transMeta);\n// after\nFile out = new File(zipFilename);\nif (!out.getParentFile().exists()) out.getParentFile().mkdirs();\nTopLevelResource res = ResourceUtil.serializeResourceExportInterface(zipFilename, exportable, transMeta);","handlingStrategy":"try-catch","validationCode":"File out = new File(zipFilename);\nif (out.getParentFile() == null || !out.getParentFile().canWrite()) {\n  throw new IllegalStateException(\"Export dir not writable: \" + out.getParent());\n}","typeGuard":null,"tryCatchPattern":"try {\n  return ResourceUtil.serializeResourceExportInterface(zipFilename, exportable, transMeta);\n} catch (KettleException e) {\n  LOG.error(\"Export serialization failed, cause: \" + e.getCause(), e);\n  throw e;\n}","preventionTips":["Ensure the export target directory exists and is writable","Verify all referenced resource files exist before export","Check disk space before large exports","Always inspect getCause(); this message is a generic wrapper"],"tags":["export","zip","io","serialization"],"backgroundTag":"file-write-failed","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"}