{"record":{"id":"591c179bbdfba7b5","repo":"pentaho/pentaho-kettle","slug":"the-properties-systems-settings-are-already-initialised","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":180,"sourceCode":"  public static final int WIDGET_STYLE_NOTEPAD = 3;\n  public static final int WIDGET_STYLE_GRAPH = 4;\n  public static final int WIDGET_STYLE_TAB = 5;\n  public static final int WIDGET_STYLE_TOOLBAR = 6;\n\n  /**\n   * Initialize the properties: load from disk.\n   *\n   * @param display\n   *          The Display\n   * @param t\n   *          The type of properties file.\n   */\n  public static final void init( int t ) {\n    if ( props == null ) {\n      props = new Props( t );\n\n    } 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    }","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/Props.java#L162-L198","documentation":"Props.init(int) is a one-shot static initializer for Kettle's global properties (kettle.properties). It throws RuntimeException if Props has already been initialized, because re-initializing would discard loaded settings.","triggerScenarios":"Calling Props.init(type) twice in the same JVM — e.g. initializing in both a bootstrap class and a plugin, or re-running init after Props.getInstance() already created the instance.","commonSituations":"Embedding Pentaho in a long-lived application server where multiple components each call Props.init, unit tests initializing Props in a shared JVM, hot-reloading code that calls init again without resetting the singleton.","solutions":["Call Props.init only once per JVM; rely on Props.getInstance() afterwards","Guard calls with a check: if not yet initialized, wrap in try-catch and ignore the second initialization","Test-only: reset the singleton via reflection or restructure code so init happens in one bootstrap location","Move initialization into a single shared bootstrap module used by all components"],"exampleFix":"// before\nProps.init(Props.TYPE_PROPERTIES_KETTLE); // called in two places\n// after\nif (!Props.isInitialized()) {\n  Props.init(Props.TYPE_PROPERTIES_KETTLE);\n}","handlingStrategy":"try-catch","validationCode":"// idempotent init helper\npublic static synchronized void initPropsOnce(int type) {\n  try { Props.init(type); } catch (RuntimeException already) { /* ignore */ }\n}","typeGuard":null,"tryCatchPattern":"try {\n  Props.init(Props.TYPE_PROPERTIES_KETTLE);\n} catch (RuntimeException e) {\n  // already initialized — safe to ignore, use Props.getInstance()\n}","preventionTips":["Call Props.init exactly once, from one bootstrap location","Prefer Props.getInstance() for all subsequent access","In shared-JVM test suites, guard init with a static flag or @BeforeClass once-per-suite"],"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"}