{
  "id": "java/missing-resource-bundle",
  "signature": "java.util.MissingResourceException: Can't find bundle for base name",
  "signature_zh": "java.util.MissingResourceException：找不到基本名称的资源包",
  "regex": "java\\.util\\.MissingResourceException: Can't find bundle for base name",
  "domain": "java",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The ResourceBundle.getBundle() method cannot locate the properties file or class bundle for the specified base name, usually due to a missing file, incorrect classpath, or wrong locale.",
  "root_cause_type": "generic",
  "root_cause_zh": "ResourceBundle.getBundle() 方法找不到指定基本名称的属性文件或类包，通常是由于缺少文件、类路径不正确或区域设置错误。",
  "versions": [
    {
      "version": "Java 8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 17",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "ResourceBundle expects a .properties file or a class; an empty file with wrong extension is ignored.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "ResourceBundle falls back to the default locale, which may also be missing, causing the same error.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The base name must include the full package path; moving the file without updating the name breaks the lookup.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure the properties file exists in the classpath at the correct location. For example, if base name is `com.example.messages`, place `messages.properties` in `src/main/resources/com/example/`.",
      "success_rate": 0.95,
      "how": "Ensure the properties file exists in the classpath at the correct location. For example, if base name is `com.example.messages`, place `messages.properties` in `src/main/resources/com/example/`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the full qualified base name with package: `ResourceBundle.getBundle(\"com.example.i18n.messages\")` and ensure the file is at `com/example/i18n/messages.properties`.",
      "success_rate": 0.9,
      "how": "Use the full qualified base name with package: `ResourceBundle.getBundle(\"com.example.i18n.messages\")` and ensure the file is at `com/example/i18n/messages.properties`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Provide a default locale bundle to avoid fallback issues: add `messages.properties` (without locale suffix) as a fallback.",
      "success_rate": 0.85,
      "how": "Provide a default locale bundle to avoid fallback issues: add `messages.properties` (without locale suffix) as a fallback.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure the properties file exists in the classpath at the correct location. For example, if base name is `com.example.messages`, place `messages.properties` in `src/main/resources/com/example/`.",
    "Use the full qualified base name with package: `ResourceBundle.getBundle(\"com.example.i18n.messages\")` and ensure the file is at `com/example/i18n/messages.properties`.",
    "Provide a default locale bundle to avoid fallback issues: add `messages.properties` (without locale suffix) as a fallback."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.oracle.com/javase/8/docs/api/java/util/ResourceBundle.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-03-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}