pentaho/pentaho-kettle · error · KettleException

ResourceUtil.Exception.NoResourcesFoundToExport

ResourceUtil.Exception.NoResourcesFoundToExport

Error message

ResourceUtil.Exception.NoResourcesFoundToExport

What it means

ResourceUtil.serializeResourceExportInterface throws this KettleException when the export produced no resources to package: the resource list was empty so there is nothing to zip into the export file. The message comes from the message bundle key ResourceUtil.Exception.NoResourcesFoundToExport.

Solutions

  1. Ensure the job/transformation actually references resources (set file paths so ResourceReference entries are produced)
  2. Check the export type/ResourceExportInterface implementation registers resources before serialization
  3. Verify resource-related transformation settings (e.g. 'Copy or distribute files' / export options) are not suppressing resource collection
  4. Handle the empty-resource case by exporting the file as-is instead of zipping

Example fix

// before
TopLevelResource res = ResourceUtil.serializeResourceExportInterface(zipFilename, exportable, transMeta);
// after
List<ResourceReference> refs = exportable.getResourceDependencies(transMeta);
if (refs.isEmpty()) {
  LOG.warn("No resources to export; writing file directly");
} else {
  TopLevelResource res = ResourceUtil.serializeResourceExportInterface(zipFilename, exportable, transMeta);
}
Defensive patterns

Strategy: validation

Validate before calling

List<ResourceReference> refs = exportable.getResourceDependencies(transMeta);
if (refs == null || refs.isEmpty()) {
  LOG.warn("No resources to export; skipping zip export");
  return null;
}

Try / catch

try {
  return ResourceUtil.serializeResourceExportInterface(zipFilename, exportable, transMeta);
} catch (KettleException e) {
  if (e.getMessage() != null && e.getMessage().contains("NoResourcesFound")) {
    return null; // nothing to export
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling serializeResourceExportInterface on an object whose buildResourceNames/ResourceReference list resolves to zero resource entries (no files registered for export), causing the else branch after the resource-writing loop.

Common situations: Exporting a job/transformation that references no external files; resource export settings (original files vs. zip) misconfigured so nothing is registered; programmatically exporting an object before it loaded its referenced resources.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/6747c6c6f229307b. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/resource/ResourceUtil.java:144

          String filename = entry.getKey();
          ResourceDefinition resourceDefinition = entry.getValue();

          ZipEntry zipEntry = new ZipEntry( resourceDefinition.getFilename() );

          String comment =
            BaseMessages.getString(
              PKG, "ResourceUtil.SerializeResourceExportInterface.ZipEntryComment.OriginatingFile", filename,
              Const.NVL( resourceDefinition.getOrigin(), "-" ) );
          zipEntry.setComment( comment );
          out.putNextEntry( zipEntry );

          out.write( resourceDefinition.getContent().getBytes() );
          out.closeEntry();
        }
        String zipURL = fileObject.getName().toString();
        return new TopLevelResource( topLevelResource, zipURL, "zip:" + zipURL + "!" + topLevelResource );
      } else {
        throw new KettleException( BaseMessages.getString( PKG, "ResourceUtil.Exception.NoResourcesFoundToExport" ) );
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "ResourceUtil.Exception.ErrorSerializingExportInterface", resourceExportInterface.toString() ), e );
    } finally {
      if ( out != null ) {
        try {
          out.close();
        } catch ( IOException e ) {
          throw new KettleException( BaseMessages.getString(
            PKG, "ResourceUtil.Exception.ErrorClosingZipStream", zipFilename ) );
        }
      }
    }
  }

  public static String getExplanation( String zipFilename, String launchFile,
    ResourceExportInterface resourceExportInterface ) {

View on GitHub (pinned to f3058517a1)