{"record":{"id":"7679c11cd52c4dfc","repo":"pentaho/pentaho-kettle","slug":"cannot-load-dialog-due-to-error-in-initialization","errorCode":null,"errorMessage":"Cannot load dialog due to error in initialization.","messagePattern":"Cannot load dialog due to error in initialization\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"ui/src/main/java/org/pentaho/di/ui/xul/common/preview/AbstractPreviewRowsXulDialog.java","lineNumber":85,"sourceCode":"  private int maxRows;\n\n  private XulProgressmeter progressMeter;\n\n  public AbstractPreviewRowsXulDialog( Object parent, BaseStepMeta stepMeta, int maxRows ) {\n\n    this.xulFile = \"org/pentaho/di/ui/xul/common/preview/xul/preview_rows.xul\";\n    this.parent = parent;\n    this.meta = stepMeta;\n    this.maxRows = maxRows;\n\n    log = new LogChannel( \"Row Preview\" );\n\n    try {\n      initializeXul();\n      progressMeter = (XulProgressmeter) document.getElementById( \"progress\" );\n    } catch ( Exception e ) {\n      log.logError( \"Error initializing dialog...\", e );\n      throw new IllegalStateException( \"Cannot load dialog due to error in initialization.\", e );\n    }\n  }\n\n  public void init() {\n\n    final List<String> columns = new ArrayList<String>();\n    final List<Object[]> data = new ArrayList<Object[]>();\n\n    previewStep( data, columns );\n    createPreviewRows( data, columns );\n\n  }\n\n  /**\n   * TODO: This method should not be necessary once a XulTable can take bindings for creating xulcolumn definitions at\n   * runtime and mapping the data to the columns.\n   *\n   * @param data","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/ui/src/main/java/org/pentaho/di/ui/xul/common/preview/AbstractPreviewRowsXulDialog.java#L67-L103","documentation":"AbstractPreviewRowsXulDialog's constructor calls initializeXul() to load and bind its XUL document; any failure (missing XUL file, XulParseException, binding error) is logged and rethrown as an IllegalStateException. The dialog cannot be displayed at all when this fires.","triggerScenarios":"Constructing a preview dialog (e.g. PreviewRowsXulDialog) when initializeXul() fails — typically because the XUL document resource cannot be found/loaded, a required XulSpoonSettings/JarfileLoader is unavailable, or getElementById wiring throws.","commonSituations":"Corrupted or incomplete PDI installation missing UI XUL resources; classloader issues when embedding Kettle; Kettle version mismatch where XUL files moved; running outside Spoon without required SWT/XUL environment.","solutions":["Inspect the logged 'Error initializing dialog...' cause to find the underlying XUL failure","Reinstall/repair the PDI UI resources so the XUL document exists on the classpath","Verify Kettle plugin/UI versions are consistent (no mixed jars)","Check the classloader/thread context when embedding Kettle in another app"],"exampleFix":"// before: constructing dialog in a broken environment throws IllegalStateException\nnew PreviewRowsXulDialog(shell, variables, true, rows, \"Preview\");\n// after: guard construction and surface cause\ntry {\n  new PreviewRowsXulDialog(shell, variables, true, rows, \"Preview\");\n} catch (IllegalStateException e) {\n  log.logError(\"Preview dialog unavailable\", e.getCause());\n}","handlingStrategy":"try-catch","validationCode":"// verify XUL resource exists before constructing the dialog\nboolean xulAvailable = Thread.currentThread().getContextClassLoader()\n  .getResource(\"org/pentaho/di/ui/xul/common/preview/previewRows.xul\") != null; // adjust per dialog document","typeGuard":null,"tryCatchPattern":"try {\n  PreviewRowsXulDialog dlg = new PreviewRowsXulDialog(shell, variables, true, rows, title);\n  dlg.init();\n} catch (IllegalStateException e) {\n  log.logError(\"Preview dialog initialization failed\", e.getCause());\n  // fall back to a plain SWT message box\n}","preventionTips":["Keep the full PDI UI distribution intact (XUL files, jars)","Avoid mixing Kettle/plugin jar versions in the classpath","Always log and inspect the chained cause — the IllegalStateException wraps the original XUL error","When embedding Kettle, ensure the correct context classloader is set on the UI thread"],"tags":["xul","dialog-initialization","kettle","ui"],"backgroundTag":"module-init-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"}