{"record":{"id":"e85d39f288fcbe1d","repo":"pentaho/pentaho-kettle","slug":"the-properties-systems-settings-are-already-initialised-e85d39","errorCode":null,"errorMessage":"The properties systems settings are already initialised!","messagePattern":"The properties systems settings are already initialised!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/Props.java","lineNumber":197,"sourceCode":"    } else {\n      throw new RuntimeException( \"The Properties systems settings are already initialised!\" );\n    }\n  }\n\n  /**\n   * Initialize the properties: load from disk.\n   *\n   * @param display\n   *          The Display\n   * @param filename\n   *          the filename to use\n   */\n  public static final void init( String filename ) {\n    if ( props == null ) {\n      props = new Props( filename );\n\n    } else {\n      throw new RuntimeException( \"The properties systems settings are already initialised!\" );\n    }\n  }\n\n  /**\n   * Check to see whether the Kettle properties where loaded.\n   *\n   * @return true if the Kettle properties where loaded.\n   */\n  public static boolean isInitialized() {\n    return props != null;\n  }\n\n  public static Props getInstance() {\n    if ( props != null ) {\n      return props;\n    }\n\n    throw new RuntimeException( \"Properties, Kettle systems settings, not initialised!\" );","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/Props.java#L179-L215","documentation":"Props.init(String filename) initializes Kettle's global properties from a specific file. It throws RuntimeException if Props was already initialized, protecting the process-wide singleton from being loaded twice with different files.","triggerScenarios":"Calling Props.init(filename) after any prior Props.init(...) or after Props.getInstance() created the default instance — e.g. loading kettle.properties then attempting to load a custom properties file.","commonSituations":"Applications wanting a custom kettle.properties path but calling the default init first, test suites running multiple init calls, framework code initializing Props before application code does.","solutions":["Choose one init path per JVM (either default init(int) or init(String)) and call it exactly once","Check initialization state before calling; catch RuntimeException for idempotent behavior","Pass the custom file via the supported configuration mechanism instead of a second init call","If the custom file must win, ensure it is the only init call in the process bootstrap"],"exampleFix":"// before\nProps.init(Props.TYPE_PROPERTIES_KETTLE);\nProps.init(\"/custom/kettle.properties\"); // throws\n// after\nProps.init(\"/custom/kettle.properties\"); // single init only","handlingStrategy":"try-catch","validationCode":"public static synchronized void initPropsFromFile(String filename) {\n  try { Props.init(filename); } catch (RuntimeException already) { /* ignore */ }\n}","typeGuard":null,"tryCatchPattern":"try {\n  Props.init(\"/custom/kettle.properties\");\n} catch (RuntimeException e) {\n  // Props already initialized elsewhere; proceed with existing instance\n}","preventionTips":["Never mix init(int) and init(String) in the same JVM","Decide the properties source at startup and configure it there","Check initialization state or catch-and-ignore for idempotency"],"tags":["singleton","initialization","lifecycle","configuration"],"backgroundTag":"invalid-state-transition","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"}