{"record":{"id":"62d9fd541d3f017b","repo":"quarkusio/quarkus","slug":"multiple-handler-classes-you-have-a-custom-handl","errorCode":null,"errorMessage":"Multiple handler classes.  You have a custom handler class and the <provider> extension.  Please remove one of them from your deployment.","messagePattern":"Multiple handler classes\\.  You have a custom handler class and the <provider> extension\\.  Please remove one of them from your deployment\\.","errorType":"exception","errorClass":"BuildException","httpStatus":null,"severity":"error","filePath":"extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaProcessor.java","lineNumber":100,"sourceCode":"\n    @BuildStep\n    List<AmazonLambdaBuildItem> discover(CombinedIndexBuildItem combinedIndexBuildItem,\n            Optional<ProvidedAmazonLambdaHandlerBuildItem> providedLambda,\n            BuildProducer<AdditionalBeanBuildItem> additionalBeanBuildItemBuildProducer,\n            BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchy,\n            BuildProducer<ReflectiveClassBuildItem> reflectiveClassBuildItemBuildProducer) throws BuildException {\n\n        List<ClassInfo> requestHandlers = new ArrayList<>(\n                combinedIndexBuildItem.getIndex().getAllKnownImplementations(REQUEST_HANDLER)\n                        .stream().filter(INCLUDE_HANDLER_PREDICATE).toList());\n\n        List<ClassInfo> streamHandlers = new ArrayList<>(combinedIndexBuildItem.getIndex()\n                .getAllKnownImplementations(REQUEST_STREAM_HANDLER).stream().filter(INCLUDE_HANDLER_PREDICATE).toList());\n        streamHandlers.addAll(combinedIndexBuildItem.getIndex()\n                .getAllKnownSubclasses(SKILL_STREAM_HANDLER).stream().filter(INCLUDE_HANDLER_PREDICATE).toList());\n\n        if ((!requestHandlers.isEmpty() || !streamHandlers.isEmpty()) && providedLambda.isPresent()) {\n            throw new BuildException(\n                    \"Multiple handler classes.  You have a custom handler class and the \" + providedLambda.get().getProvider()\n                            + \" extension.  Please remove one of them from your deployment.\",\n                    List.of());\n\n        }\n        AdditionalBeanBuildItem.Builder additionalBeansBuilder = AdditionalBeanBuildItem.builder().setUnremovable();\n        List<AmazonLambdaBuildItem> amazonLambdas = new ArrayList<>();\n\n        for (ClassInfo requestHandler : requestHandlers) {\n            if (requestHandler.isAbstract()) {\n                continue;\n            }\n\n            additionalBeansBuilder.addBeanClass(requestHandler.name().toString());\n            amazonLambdas.add(new AmazonLambdaBuildItem(requestHandler.name().toString(), getCdiName(requestHandler), false));\n        }\n\n        for (ClassInfo streamHandler : streamHandlers) {","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaProcessor.java#L82-L118","documentation":"The Amazon Lambda deployment processor found both your own RequestHandler/RequestStreamHandler implementations and a handler provided by another extension (e.g. SQS, SNSS Event handler extension). Only one Lambda handler source may exist per deployment.","triggerScenarios":"discover() runs at build time; requestHandlers/streamHandlers from the combined index are non-empty AND providedLambda (a provider extension's handler) is present.","commonSituations":"Adding quarkus-amazon-lambda-sqs (or another provider) to a project that also contains a custom implements RequestHandler class; leftover example handler class from an archetype after adding a provider extension.","solutions":["Remove your custom handler class (or the archetype-generated one) and rely on the provider extension's handler","Or remove the provider extension dependency if you intend to handle events yourself","Check dependencies for multiple quarkus-amazon-lambda-* provider modules and keep only one strategy"],"exampleFix":"// before\nclass MyHandler implements RequestHandler<SqsEvent, Void> { ... }\n<dependency>io.quarkus:quarkus-amazon-lambda-sqs</dependency>\n// after\n// delete MyHandler, keep the quarkus-amazon-lambda-sqs dependency (or vice versa)","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one handler strategy per deployment: custom class OR provider extension","Remove archetype sample handlers after adding provider extensions","Audit pom.xml for multiple quarkus-amazon-lambda-* provider modules","Run mvn quarkus:dev early to catch build-step conflicts"],"tags":["quarkus","amazon-lambda","build","handler-conflict"],"backgroundTag":"ambiguous-handler-class","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"}