{
  "id": "java/missing-resource-bundle-exception",
  "signature": "java.util.MissingResourceException: Can't find bundle for base name messages, locale en_US",
  "signature_zh": "java.util.MissingResourceException: 找不到基本名称为 messages、语言环境为 en_US 的资源包",
  "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 a .properties file for the given base name and locale, often due to a missing file, incorrect path, or classpath issue.",
  "root_cause_type": "generic",
  "root_cause_zh": "ResourceBundle.getBundle 方法无法找到给定基本名称和语言环境的 .properties 文件，通常是由于文件缺失、路径错误或类路径问题。",
  "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": "An empty file may cause other parsing errors or missing key exceptions; the file must contain valid key-value pairs for the application to function.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "ResourceBundle expects the file to be in the same package as the class or in a specified path; incorrect placement leads to the same error.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure the properties file (e.g., messages.properties) is in the classpath under the correct package path, e.g., src/main/resources/com/example/messages.properties for base name 'com.example.messages'.",
      "success_rate": 0.9,
      "how": "Ensure the properties file (e.g., messages.properties) is in the classpath under the correct package path, e.g., src/main/resources/com/example/messages.properties for base name 'com.example.messages'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use ResourceBundle.getBundle with a ClassLoader: ResourceBundle.getBundle(\"messages\", locale, Thread.currentThread().getContextClassLoader())",
      "success_rate": 0.8,
      "how": "Use ResourceBundle.getBundle with a ClassLoader: ResourceBundle.getBundle(\"messages\", locale, Thread.currentThread().getContextClassLoader())",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure the properties file (e.g., messages.properties) is in the classpath under the correct package path, e.g., src/main/resources/com/example/messages.properties for base name 'com.example.messages'.",
    "Use ResourceBundle.getBundle with a ClassLoader: ResourceBundle.getBundle(\"messages\", locale, Thread.currentThread().getContextClassLoader())"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/MissingResourceException.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-02-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}