{"record":{"id":"fb1162d7313a4a66","repo":"quarkusio/quarkus","slug":"unable-to-implement-interface-because-it-is-not","errorCode":null,"errorMessage":"Unable to implement${interface} because it is not known - please make sure it's part of the Quarkus index","messagePattern":"Unable to implement(.+?) because it is not known - please make sure it's part of the Quarkus index","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/FragmentMethodsAdder.java","lineNumber":43,"sourceCode":"    private final Consumer<String> fragmentImplClassResolvedCallback;\n    private final IndexView index;\n\n    public FragmentMethodsAdder(Consumer<String> fragmentImplClassResolvedCallback, IndexView index) {\n        this.fragmentImplClassResolvedCallback = fragmentImplClassResolvedCallback;\n        this.index = index;\n    }\n\n    public void add(ClassCreator classCreator, String generatedClassName,\n            List<DotName> customInterfaceNamesToImplement, Map<String, FieldDesc> customImplNameToHandle,\n            Set<String> existingMethods) {\n        for (DotName customInterfaceToImplement : customInterfaceNamesToImplement) {\n            String customImplementationClassName = FragmentMethodsUtil\n                    .getImplementationDotName(customInterfaceToImplement, index).toString();\n            fragmentImplClassResolvedCallback.accept(customImplementationClassName);\n\n            ClassInfo customInterfaceToImplementClassInfo = index.getClassByName(customInterfaceToImplement);\n            if (customInterfaceToImplementClassInfo == null) {\n                throw new IllegalArgumentException(\"Unable to implement\" + customInterfaceToImplement\n                        + \" because it is not known - please make sure it's part of the Quarkus index\");\n            }\n\n            for (MethodInfo methodToImplement : customInterfaceToImplementClassInfo.methods()) {\n                // methods defined on the interface are implemented by forwarding them to the bean that implements them\n\n                String[] methodParameterTypes = new String[methodToImplement.parametersCount()];\n                for (int i = 0; i < methodToImplement.parametersCount(); i++) {\n                    methodParameterTypes[i] = methodToImplement.parameterType(i).name().toString();\n                }\n\n                String methodReturnType = methodToImplement.returnType().name().toString();\n                String methodKey = GenerationUtil.methodKey(methodToImplement.name(), methodReturnType,\n                        methodParameterTypes);\n\n                if (!existingMethods.contains(methodKey)) {\n                    // Build the MethodTypeDesc\n                    MethodTypeDesc mtd = GenerationUtil.toMethodTypeDesc(methodReturnType, methodParameterTypes);","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/generate/FragmentMethodsAdder.java#L25-L61","documentation":"During Spring Data JPA augmentation, Quarkus generates an implementation for each custom fragment interface declared by a repository. This error is thrown when the fragment interface itself cannot be found in the application's Jandex index, so Quarkus cannot inspect its methods to generate forwarding code. It means the interface is not visible to the build-time index.","triggerScenarios":"A repository extends a custom fragment interface (e.g. MyRepositoryCustom) that is not indexed: the interface lives in a dependency JAR not indexed by Quarkus, is in a source folder excluded from indexing, or its name/class referenced by the repository was compiled outside the application index.","commonSituations":"Fragment interfaces placed in a separate un-indexed library module; using a compiled-only dependency without a Jandex INDEX.LST; IDE stale builds; moving interfaces to a package ignored by the Quarkus index.","solutions":["Ensure the fragment interface is in the application project (indexed source) rather than an external JAR","If the interface is in a dependency JAR, add a META-INF/jandex.idx to that JAR or register the JAR for indexing in the Quarkus build plugin (quarkus.index-dependency.*)","Run a clean rebuild to refresh the Jandex index","Verify the repository's generic signature references the exact interface name available on the classpath"],"exampleFix":"// pom.xml of a library containing fragment interfaces\n<plugin>\n  <groupId>io.smallrye</groupId>\n  <artifactId>jandex-maven-plugin</artifactId>\n  <executions><execution><id>make-index</id><goals><goal>jandex</goal></goals></execution></executions>\n</plugin>","handlingStrategy":"validation","validationCode":"// In a test or build check: ensure fragment interfaces are application classes\nassert new java.io.File(\"src/main/java/com/example/PersonRepositoryCustom.java\").exists();\n// For external JARs, verify index exists:\n// unzip -l libs/my-fragments.jar | grep META-INF/jandex.idx","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep fragment interfaces and their Impl classes in the application's own source tree","Index third-party JARs containing repositories via jandex-maven-plugin or quarkus.index-dependency.*","Clean-rebuild after moving classes between modules"],"tags":["quarkus","spring-data-jpa","jandex-index","build-time"],"backgroundTag":"class-not-in-quarkus-index","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}