{"record":{"id":"fc20ccfafe056191","repo":"pentaho/pentaho-kettle","slug":"unable-to-find-properties-file-for-package-packagepath-and","errorCode":null,"errorMessage":"Unable to find properties file for package '${packagePath}' and class '${resourceClass}' in the available locales: ${activeLocales}","messagePattern":"Unable to find properties file for package '(.+?)' and class '(.+?)' in the available locales: (.+?)","errorType":"exception","errorClass":"MissingResourceException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/i18n/GlobalMessageUtil.java","lineNumber":303,"sourceCode":"  public static ResourceBundle getBundle( final String packagePath, final Class<?> resourceClass )\n    throws MissingResourceException {\n    final Set<Locale> activeLocales = getActiveLocales();\n    for ( final Locale locale : activeLocales ) {\n      try {\n        return getBundle( locale, packagePath, resourceClass );\n      } catch ( MissingResourceException e ) {\n        final StringBuilder msg = new StringBuilder();\n        msg.append( \"Unable to find properties file for package '\" ).append( packagePath ).append( \"' and class '\" )\n          .append( resourceClass.getName() ).append( \"' in the available locales: \" ).append( locale );\n        // nothing to do, an exception will be thrown if no bundle is found\n        log.warn( msg.toString() );\n      }\n    }\n    final StringBuilder msg = new StringBuilder();\n    msg.append( \"Unable to find properties file for package '\" ).append( packagePath ).append( \"' and class '\" )\n      .append( resourceClass.getName() ).append( \"' in the available locales: \" ).append(\n      Arrays.asList( activeLocales ) );\n    throw new MissingResourceException( msg.toString(), resourceClass.getName(),\n      packagePath );\n  }\n\n  public static ResourceBundle getBundle( Locale locale, String packagePath, Class<?> resourceClass ) {\n    return getBundle( locale, packagePath, resourceClass, true );\n  }\n\n  /**\n   * Returns a {@link ResourceBundle} corresponding to the given {@link Locale} package and resource class. Falls-back\n   * on the ROOT {@link Locale}, if the {@code fallbackOnRoot} flag is true and the requested Locale is not available.\n   *\n   * @param locale         the {@link Locale} for which the {@link ResourceBundle} is being requested\n   * @param packagePath\n   * @param resourceClass\n   * @param fallbackOnRoot if true, and a {@link ResourceBundle} cannot be found for the requested {@link Locale}, falls\n   *                       back on the ROOT {@link Locale}\n   * @return a {@link ResourceBundle} corresponding to the given {@link Locale} package and resource class\n   */","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/i18n/GlobalMessageUtil.java#L285-L321","documentation":"getBundle iterates the active locales looking for a properties resource bundle for a package/class; if no locale yields a bundle, it throws MissingResourceException with 'Unable to find properties file for package ... and class ... in the available locales: ...'. It means the i18n resource file is absent from the classpath for every configured locale.","triggerScenarios":"BaseMessages.getString(PKG, key) where the package's messages files (e.g. messages/messages_en_US.properties) are missing from the classpath for all active locales — typically because the jar was built without resources or PKG points at a wrong package path.","commonSituations":"Shading/proguard stripping .properties resources, wrong package name passed as PKG, custom plugin missing its messages folder, renaming packages without moving messages files, classpath misconfiguration in the plugin folder.","solutions":["Verify the properties file exists at <packagePath>/messages/messages_<locale>.properties inside the jar (unzip -l plugin.jar | grep properties).","Fix the PKG package string so it matches the location of the messages resources.","Rebuild with Maven so resources are included (check resource filtering/excludes didn't strip .properties).","Ensure the plugin jar is on the classpath (lib/ or plugins/<plugin>/) and no proguard/shade config excludes it."],"exampleFix":"// before\nprivate static final Class<?> PKG = WrongPackage.class; // messages not under this package\n// after\nprivate static final Class<?> PKG = MyPlugin.class; // messages/ sits beside MyPlugin.class\n// resources: src/main/resources/org/example/myplugin/messages/messages_en_US.properties","handlingStrategy":"try-catch","validationCode":"try {\n  GlobalMessageUtil.getBundle(locale, packagePath, resourceClass);\n} catch (MissingResourceException e) { /* bundle missing on classpath */ }","typeGuard":"boolean bundlePresent(Class<?> cls) {\n  String p = cls.getPackage().getName().replace('.', '/') + \"/messages/messages_en.properties\";\n  return cls.getClassLoader().getResource(p) != null;\n}","tryCatchPattern":"try {\n  msg = BaseMessages.getString(PKG, key);\n} catch (MissingResourceException e) {\n  log.warn(\"Missing bundle for \" + PKG + \", using key \" + key);\n  msg = key;\n}","preventionTips":["Verify messages/*.properties are packaged in the jar (unzip -l)","Keep PKG pointing at a class in the package containing messages/","Add a unit test that loads the default-locale bundle at class-init time"],"tags":["i18n","missing-resource","classpath"],"backgroundTag":"resource-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"}