{
  "id": "ros2/component-container-isolated-failed-load",
  "signature": "[component_container_isolated]: Failed to load component: Failed to find class with name 'my_pkg::MyComponent': No match",
  "signature_zh": "[component_container_isolated]：加载组件失败：未找到名为 'my_pkg::MyComponent' 的类：无匹配项",
  "regex": "\\[component_container_isolated\\]: Failed to load component: Failed to find class with name '[^']+'",
  "domain": "ros2",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The component class is not registered with the component container; either the class export macro is missing or the package's plugin description XML is incorrect.",
  "root_cause_type": "generic",
  "root_cause_zh": "组件类未向组件容器注册；要么缺少类导出宏，要么包的插件描述 XML 不正确。",
  "versions": [
    {
      "version": "ROS 2 Humble",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ROS 2 Iron",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ROS 2 Rolling",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Recompiling the package without cleaning build artifacts",
      "why_fails": "The issue is in plugin registration, not compilation; rebuild doesn't fix missing exports.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "Manually copying the .so file to the container's library path",
      "why_fails": "The container loads via pluginlib, not direct library loading; registration is required.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using component_container instead of component_container_isolated",
      "why_fails": "Both containers use the same plugin registration mechanism; the error will persist.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add the RCLCPP_COMPONENTS_REGISTER_NODE macro to your component source file: `RCLCPP_COMPONENTS_REGISTER_NODE(my_pkg::MyComponent)` and ensure the package.xml exports the plugin: `<export><build_type>ament_cmake</build_type><ros2_component plugin=\"${prefix}/my_plugins.xml\"/></export>`",
      "success_rate": 0.9,
      "how": "Add the RCLCPP_COMPONENTS_REGISTER_NODE macro to your component source file: `RCLCPP_COMPONENTS_REGISTER_NODE(my_pkg::MyComponent)` and ensure the package.xml exports the plugin: `<export><build_type>ament_cmake</build_type><ros2_component plugin=\"${prefix}/my_plugins.xml\"/></export>`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check the plugin description XML file (e.g., my_plugins.xml) for correct library path: `<library path=\"libmy_pkg_component\"><class type=\"my_pkg::MyComponent\" base_class_type=\"rclcpp::Node\"/></library>`",
      "success_rate": 0.85,
      "how": "Check the plugin description XML file (e.g., my_plugins.xml) for correct library path: `<library path=\"libmy_pkg_component\"><class type=\"my_pkg::MyComponent\" base_class_type=\"rclcpp::Node\"/></library>`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Run `ros2 component types` to verify the component is registered; if not listed, the export is missing.",
      "success_rate": 0.75,
      "how": "Run `ros2 component types` to verify the component is registered; if not listed, the export is missing.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在组件源文件中添加 RCLCPP_COMPONENTS_REGISTER_NODE 宏：`RCLCPP_COMPONENTS_REGISTER_NODE(my_pkg::MyComponent)`，并确保 package.xml 导出插件：`<export><build_type>ament_cmake</build_type><ros2_component plugin=\"${prefix}/my_plugins.xml\"/></export>`",
    "检查插件描述 XML 文件（例如 my_plugins.xml）中的库路径是否正确：`<library path=\"libmy_pkg_component\"><class type=\"my_pkg::MyComponent\" base_class_type=\"rclcpp::Node\"/></library>`",
    "运行 `ros2 component types` 验证组件是否已注册；如果未列出，则导出缺失。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.ros.org/en/humble/Tutorials/Intermediate/Composition.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-09-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}