{"record":{"id":"77eb327bf7720dca","repo":"pentaho/pentaho-kettle","slug":"pentahoreportingoutput-exception","errorCode":null,"errorMessage":"PentahoReportingOutput.Exception.UnexpectedErrorRenderingReport","messagePattern":"PentahoReportingOutput\\.Exception\\.UnexpectedErrorRenderingReport","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/PentahoReportingOutput.java","lineNumber":467,"sourceCode":"\n        if ( context.getStatusType() == StatusType.ERROR ) {\n          KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( targetFilename, getTransMeta() ).delete();\n          if ( context.getCause() != null ) {\n            throw context.getCause();\n          }\n          throw new KettleStepException( context.getMessage() );\n        }\n\n        ResultFile resultFile =\n          new ResultFile(\n            ResultFile.FILE_TYPE_GENERAL, KettleVFS.getInstance( getTransMeta().getBowl() )\n            .getFileObject( targetFilename, getTransMeta() ),\n            getTransMeta().getName(), getStepname() );\n        resultFile.setComment( \"This file was created with a Pentaho Reporting Output step\" );\n        addResultFile( resultFile );\n\n      } catch ( Throwable e ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"PentahoReportingOutput.Exception.UnexpectedErrorRenderingReport\", sourceFilename, targetFilename,\n          outputProcessorType.getDescription() ), e );\n      }\n    } finally {\n      //Restore the original class loader\n      Thread.currentThread().setContextClassLoader( old );\n    }\n  }\n\n  private Class<?> findParameterClass( ReportParameterDefinition definition, String parameterName ) {\n    for ( int i = 0; i < definition.getParameterCount(); i++ ) {\n      ParameterDefinitionEntry entry = definition.getParameterDefinition( i );\n      if ( parameterName.equals( entry.getName() ) ) {\n\n        return entry.getValueType();\n      }\n    }\n    return null;","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/PentahoReportingOutput.java#L449-L485","documentation":"processReport wraps any Throwable raised while rendering the report (loading the prpt file, preparing the output processor, writing the target) into a KettleException with message PentahoReportingOutput.Exception.UnexpectedErrorRenderingReport, including source and target filenames and the output type description. It is the catch-all guard of the reporting output step; the original exception is attached as the cause.","triggerScenarios":"Any exception inside the try block of processReport: report file cannot be parsed, PdfReportUtil/OutputProcessor cannot handle the selected ProcessorType, VFS cannot open source or target file, or an error thrown inside the rendering pipeline.","commonSituations":"Corrupt or wrong-version .prpt report file; target filename with unsupported extension for the chosen processor type (e.g. PDF processor writing to .xlsx); missing write permissions on the output directory; classloader/resource issues in the plugin environment.","solutions":["Read the chained 'Caused by' exception — this wrapper only adds context; the cause identifies the real failure","Confirm the target file extension matches the selected output processor type (PDF->.pdf, Excel->.xls etc.)","Verify the source .prpt file exists, is readable, and was produced with a compatible Pentaho Reporting version","Check write permissions on the target directory and that the parent folder exists"],"exampleFix":"// before\nnew KettleException( BaseMessages.getString( PKG, \"PentahoReportingOutput.Exception.UnexpectedErrorRenderingReport\", ... ), e )\n// after\n// keep the wrapper, but log the cause explicitly before throwing to ease debugging:\nlogError( BaseMessages.getString( PKG, \"PentahoReportingOutput.Exception.UnexpectedErrorRenderingReport\",\n  sourceFilename, targetFilename, outputProcessorType.getDescription() ), e );\nthrow new KettleException( BaseMessages.getString( PKG,\n  \"PentahoReportingOutput.Exception.UnexpectedErrorRenderingReport\", sourceFilename,\n  targetFilename, outputProcessorType.getDescription() ), e );","handlingStrategy":"try-catch","validationCode":"FileObject src = KettleVFS.getInstance( bowl ).getFileObject( sourceFilename, transMeta );\nif ( src == null || !src.exists() || !src.isReadable() ) {\n  throw new KettleException( \"Report source unreadable: \" + sourceFilename );\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processReport(...);\n} catch ( KettleException e ) {\n  Throwable root = e;\n  while ( root.getCause() != null ) root = root.getCause();\n  logError( \"Render failed, root cause: \" + root, root );\n  throw e;\n}","preventionTips":["Always match target file extension to the selected output processor type","Validate .prpt source files exist and load before production runs","Keep Pentaho Reporting engine and plugin versions aligned","Pre-create and permission-check the output directory"],"tags":["kettle","reporting","rendering"],"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"}