{"record":{"id":"6be07e59ab17b860","repo":"GoogleContainerTools/jib","slug":"extension-crashed-ex-getmessage-6be07e","errorCode":null,"errorMessage":"extension crashed: ${ex.getMessage()}","messagePattern":"extension crashed: (.+?)","errorType":"exception","errorClass":"JibPluginExtensionException","httpStatus":null,"severity":"error","filePath":"jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java","lineNumber":686,"sourceCode":"                + extraConfigType.get().getName()\n                + \"\\\">\");\n      } else {\n        // configs is of type Optional, so this cast always succeeds\n        // without the isInstance() check above. (Note generic <T> is erased at runtime.)\n        extraConfig = (Optional<T>) configs;\n      }\n    }\n\n    try {\n      return ((JibMavenPluginExtension<T>) extension)\n          .extendContainerBuildPlan(\n              buildPlan,\n              config.getProperties(),\n              extraConfig,\n              new MavenExtensionData(project, session),\n              new PluginExtensionLogger(this::log));\n    } catch (RuntimeException ex) {\n      throw new JibPluginExtensionException(\n          extension.getClass(), \"extension crashed: \" + ex.getMessage(), ex);\n    }\n  }\n\n  private JibMavenPluginExtension<?> findConfiguredExtension(\n      List<JibMavenPluginExtension<?>> extensions, ExtensionConfiguration config)\n      throws JibPluginExtensionException {\n    Predicate<JibMavenPluginExtension<?>> matchesClassName =\n        extension -> extension.getClass().getName().equals(config.getExtensionClass());\n    Optional<JibMavenPluginExtension<?>> found =\n        extensions.stream().filter(matchesClassName).findFirst();\n    if (!found.isPresent()) {\n      throw new JibPluginExtensionException(\n          NullExtension.class,\n          \"extension configured but not discovered on Jib runtime classpath: \"\n              + config.getExtensionClass());\n    }\n    return found.get();","sourceCodeStart":668,"sourceCodeEnd":704,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java#L668-L704","documentation":"The Jib plugin extension itself threw a RuntimeException while executing. MavenProjectProperties.runPluginExtension catches it and re-wraps it as a JibPluginExtensionException with the message 'extension crashed: <original message>', preserving the original as the cause.","triggerScenarios":"Any unchecked exception inside the extension's extendContainerBuildPlan or applyContainerBuildPlan: NPEs from missing config values, ClassNotFound/NoClassDefFound from classpath conflicts, illegal argument states in extension logic, or failures reading project resources.","commonSituations":"Third-party extensions (e.g. jib-spring-boot) hitting unexpected project layouts; extension code assuming files/classes that don't exist in this project; extension version incompatibility with the Jib core version on the plugin classpath.","solutions":["Read the caused-by stack trace below 'extension crashed' to find the real exception thrown inside the extension.","Upgrade (or align) the extension and jib-maven-plugin versions — crashes often stem from version incompatibilities.","Fix the extension's inputs: missing configuration values, absent files, or project layout assumptions that triggered the NPE/error.","If it's a third-party extension bug, reproduce minimally and report it upstream with the full stack trace."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Smoke-test the extension in isolation before wiring it into the build:\n// call extendContainerBuildPlan with a minimal plan in a unit test to surface NPEs early.","typeGuard":null,"tryCatchPattern":"try {\n  // mvn jib:build with extensions\n} catch (JibPluginExtensionException e) {\n  if (e.getMessage().startsWith(\"extension crashed:\")) {\n    e.getCause().printStackTrace(); // inspect the real RuntimeException inside the extension\n  }\n  throw e;\n}","preventionTips":["Always read the caused-by chain under 'extension crashed' — it contains the root exception.","Keep jib-maven-plugin and extension versions compatible (check the extension's supported Jib range).","Write unit tests for custom extensions covering missing-config and missing-file cases.","Pin extension versions in pom.xml; avoid floating SNAPSHOT dependencies."],"tags":["jib","plugin-extension","runtime-exception","third-party-plugin"],"backgroundTag":"upstream-api-error","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}