{"record":{"id":"d51567436827c643","repo":"pentaho/pentaho-kettle","slug":"package-file-could-not-be-found-for-file-in-folder","errorCode":null,"errorMessage":"package file could not be found for file in folder ","messagePattern":"package file could not be found for file in folder ","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"ui/src/main/java/org/pentaho/di/ui/i18n/MessagesStore.java","lineNumber":176,"sourceCode":"   */\n  public String getLoadFilename( List<String> alternativeSourceFolders ) throws FileNotFoundException {\n    String path = calcFolderName( sourceFolder );\n\n    // First try the source folder of the Java file\n    //\n    if ( new File( path ).exists() ) {\n      return path;\n    }\n\n    // Then try the rest of the project source folders in order of occurrence ..\n    //\n    for ( String altSourceFolder : alternativeSourceFolders ) {\n      path = calcFolderName( altSourceFolder );\n      if ( new File( path ).exists() ) {\n        return path;\n      }\n    }\n    throw new FileNotFoundException( \"package file could not be found for file in folder \"\n      + sourceFolder + \", with messages package \" + messagesPackage + \" in locale \" + locale );\n  }\n\n  private String calcFolderName( String sourceFolderPath ) {\n    String localeUpperLower = locale.substring( 0, 3 ).toLowerCase() + locale.substring( 3 ).toUpperCase();\n    String filename = \"messages_\" + localeUpperLower + \".properties\";\n    String path =\n      sourceFolderPath\n        + File.separator + messagesPackage.replace( '.', '/' ) + File.separator + \"messages\" + File.separator\n        + filename;\n    return path;\n  }\n\n  public String getSourceDirectory( List<String> directories ) {\n    String localeUpperLower = locale.substring( 0, 3 ).toLowerCase() + locale.substring( 3 ).toUpperCase();\n\n    String filename = \"messages_\" + localeUpperLower + \".properties\";\n    String path = messagesPackage.replace( '.', '/' );","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/ui/src/main/java/org/pentaho/di/ui/i18n/MessagesStore.java#L158-L194","documentation":"MessagesStore.getLoadFilename() throws FileNotFoundException when it cannot locate messages_<locale>.properties for the requested messages package in the primary source folder or any of the alternativeSourceFolders. The Translator needs the physical file to read/write translations; without one there is nothing to load.","triggerScenarios":"read() asks for a locale/package combination whose file exists in none of the configured source folders — wrong locale code, wrong package-to-path mapping (package dots converted to path segments), or the folder simply doesn't exist on disk.","commonSituations":"Pointing the Translator at the wrong root source folder (e.g. the UI project vs core); requesting a locale file that was never created (e.g. messages_nn.properties); packages renamed after a refactoring so the derived path no longer exists.","solutions":["Verify the derived path (sourceFolder + package-as-path + messages_<locale>.properties) actually exists; create the missing properties file if this locale is new.","Add the correct project root to the Translator's alternative source folders or fix the configured source folder.","Check the locale spelling/variant matches an existing file name exactly.","Confirm package name matches the directory structure (dots -> slashes)."],"exampleFix":"// before\n// configured source folder: /projects/pdi (UI files live in ui/)\nstore.read(); // FileNotFoundException\n\n// after\n// configure folders to include the module that owns the package\nList<String> folders = Arrays.asList( \"/projects/pdi/ui/src\", \"/projects/pdi/core/src\" );\nstore = new MessagesStore( locale, messagesPackage, props, folders );\nstore.read();","handlingStrategy":"validation","validationCode":"String path = sourceFolder + \"/\" + messagesPackage.replace( '.', '/' ) + \"/messages_\" + locale + \".properties\";\nif ( !new File( path ).exists() ) {\n  throw new IllegalStateException( \"Expected messages file missing: \" + path );\n}","typeGuard":null,"tryCatchPattern":"try {\n  store.read();\n} catch ( KettleException e ) {\n  if ( e.getCause() instanceof FileNotFoundException ) {\n    log.error( \"Locale file absent in all configured folders; check folders/locale/package\", e );\n  } else { throw e; }\n}","preventionTips":["Configure all relevant module source folders (ui, core, plugins) in the Translator","Create an empty properties file for new locales before translating","Keep package names aligned with directory structure"],"tags":["i18n","file-not-found","properties-file","locale"],"backgroundTag":"file-not-found","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"}