{"record":{"id":"ab7597f5cfaba90a","repo":"jenkinsci/jenkins","slug":"failed-to-resolve-c","errorCode":null,"errorMessage":"Failed to resolve ${c}","messagePattern":"Failed to resolve (.+?)","errorType":"exception","errorClass":"LinkageError","httpStatus":null,"severity":"error","filePath":"core/src/main/java/hudson/ExtensionFinder.java","lineNumber":557,"sourceCode":"                                method.getAnnotatedParameterTypes();\n                                method.getParameterAnnotations();\n                            }\n                        }\n\n                        // See com.google.inject.spi.InjectionPoint(TypeLiteral, Field, boolean)\n                        for (Field f : cc.getDeclaredFields()) {\n                            if (f.isAnnotationPresent(javax.inject.Inject.class)\n                                    || f.isAnnotationPresent(jakarta.inject.Inject.class)\n                                    || f.isAnnotationPresent(com.google.inject.Inject.class)) {\n                                f.getAnnotations();\n                                f.getAnnotatedType().getAnnotations();\n                                resolve(f.getType(), encountered);\n                            }\n                        }\n                    }\n                    LOGGER.log(Level.FINER, \"{0} looks OK\", c);\n                } catch (RuntimeException x) {\n                    throw new LinkageError(\"Failed to resolve \" + c, x);\n                }\n            }\n\n            @SuppressWarnings({\"unchecked\", \"ChainOfInstanceofChecks\"})\n            @Override\n            protected void configure() {\n\n                bindListener(Matchers.any(), this);\n\n                for (final IndexItem<?, Object> item : index) {\n                    boolean optional = isOptional(item.annotation());\n                    try {\n                        AnnotatedElement e = item.element();\n                        Annotation a = item.annotation();\n                        if (!isActive(a, e))   continue;\n\n                        Scope scope = optional ? QUIET_FAULT_TOLERANT_SCOPE : FAULT_TOLERANT_SCOPE;\n                        if (e instanceof Class) {","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/jenkinsci/jenkins/blob/2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc/core/src/main/java/hudson/ExtensionFinder.java#L539-L575","documentation":"Thrown by GuiceExtensionResolver.resolve(Class) when introspecting an extension class's @Inject fields, methods, and constructors raises a RuntimeException. Jenkins deliberately converts this to a LinkageError because a class that cannot have its injectable members resolved is effectively missing a dependency. The original RuntimeException is the cause.","triggerScenarios":"An @Inject field/method/constructor references a type whose class is missing or fails to load; a reflection call (getDeclaredFields/getDeclaredMethods) throws for a malformed class; resolve(f.getType()) triggers a NoClassDefFoundError or TypeNotPresentException during Guice binding setup.","commonSituations":"Plugin missing a transitive dependency jar; class compiled against an API version not present at runtime; optional dependency that is actually required by an @Inject field; class file corruption causing reflection to throw.","solutions":["Inspect the cause: NoClassDefFoundError/TypeNotPresentException names the missing type.","Install or upgrade the plugin/library that provides the missing class.","If the field is truly optional, remove @Inject or mark the extension optional in the index (@Optional).","Rebuild the plugin to align compile-time and runtime dependencies."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n    // trigger Guice extension resolution\n} catch (LinkageError e) {\n    // 'Failed to resolve' — read cause for the missing type\n    if (e.getCause() instanceof NoClassDefFoundError) { /* install missing dependency */ }\n    else throw e;\n}","preventionTips":["Keep plugin dependency versions aligned with compile-time in pom.xml.","Mark truly optional @Inject points optional, or remove @Inject if the type may be absent.","Run a smoke boot in a clean environment after dependency changes."],"tags":["guice","dependency-injection","classloading"],"backgroundTag":null,"analyzedSha":"2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc","analyzedAt":"2026-08-14T07:07:15.274Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}