{"record":{"id":"627de722cec2a500","repo":"pentaho/pentaho-kettle","slug":"kettleexception-e-exceloutputmeta","errorCode":null,"errorMessage":"KettleException( e )","messagePattern":"KettleException\\( e \\)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/exceloutput/ExcelOutputMeta.java","lineNumber":1405,"sourceCode":"   * @return the filename of the exported resource\n   */\n  @Override\n  public String exportResources( Bowl executionBowl, Bowl globalManagementBowl, VariableSpace space,\n      Map<String, ResourceDefinition> definitions, ResourceNamingInterface namingInterface,\n      Repository repository, IMetaStore metaStore ) throws KettleException {\n    try {\n      // The object that we're modifying here is a copy of the original!\n      // So let's change the filename from relative to absolute by grabbing the file object...\n      //\n      if ( !Utils.isEmpty( fileName ) ) {\n        FileObject fileObject = KettleVFS.getInstance( executionBowl )\n          .getFileObject( space.environmentSubstitute( fileName ), space );\n        fileName = namingInterface.nameResource( fileObject, space, true );\n      }\n\n      return null;\n    } catch ( Exception e ) {\n      throw new KettleException( e );\n    }\n  }\n\n  @Override\n  public StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,\n    TransMeta transMeta, Trans trans ) {\n    return new ExcelOutput( stepMeta, stepDataInterface, cnr, transMeta, trans );\n  }\n\n  @Override\n  public StepDataInterface getStepData() {\n    return new ExcelOutputData();\n  }\n\n  @Override\n  public String[] getUsedLibraries() {\n    return new String[] { \"jxl.jar\", };\n  }","sourceCodeStart":1387,"sourceCodeEnd":1423,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/exceloutput/ExcelOutputMeta.java#L1387-L1423","documentation":"In ExcelOutputMeta's external-resource path (getResourceDependencies / nameResource flow), any exception while resolving and renaming the output filename against a naming interface is wrapped in a bare KettleException. It indicates the step could not compute the resource name for its output file.","triggerScenarios":"The method calls KettleVFS.getInstance(...).getFileObject( space.environmentSubstitute( fileName ), space ) or namingInterface.nameResource(...) and either throws — invalid substituted path, VFS provider error, or naming-interface failure.","commonSituations":"Unset variables in the Excel output filename so environmentSubstitute yields a bad path; unsupported URI scheme for VFS; naming-interface misconfiguration when exporting resources; null fileName.","solutions":["Inspect the cause stack trace; the wrapper adds no detail.","Verify all ${VARIABLES} in the Excel output filename are defined in the VariableSpace at the time resources are resolved.","Test the resolved filename resolves to a valid VFS-accessible URI.","If triggered during resource export, check the export naming-interface configuration.","Guard against null/empty fileName before calling getFileObject."],"exampleFix":"// before\nFileObject fileObject = KettleVFS.getInstance( space ).getFileObject( space.environmentSubstitute( fileName ), space );\n// after\nString resolved = space.environmentSubstitute( fileName );\nif ( Const.isEmpty( resolved ) ) {\n  throw new KettleException( \"Excel output filename is empty after variable substitution\" );\n}\nFileObject fileObject = KettleVFS.getInstance( space ).getFileObject( resolved, space );","handlingStrategy":"validation","validationCode":"String resolved = space.environmentSubstitute( fileName );\nif ( Const.isEmpty( resolved ) ) throw new KettleException( \"Empty filename after substitution\" );","typeGuard":null,"tryCatchPattern":"try { /* resource naming */ } catch ( KettleException e ) { logError( \"Resource name resolution failed: \" + e.getCause(), e ); }","preventionTips":["Define every variable used in the output filename in all execution environments.","Use file: URIs supported by the configured VFS provider.","Test resource export after changing filename templates."],"tags":["pentaho-kettle","excel-output","vfs","variable-substitution","wrapped-exception"],"backgroundTag":"invalid-url","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"}