Skip to content

AWS lambda: Unable to find handler class since 3.25.0 #49413

@dagrammy

Description

@dagrammy

Describe the bug

We use the AWS lambda extension in our project. However, in 3.25.0, we can no longer run the lambdas because the following error occurs:

    java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.amazon.lambda.deployment.AmazonLambdaProcessor#recordStaticInitHandlerClass threw an exception: java.lang.RuntimeException: Unable to find handler class, make sure your deployment includes a single com.amazonaws.services.lambda.runtime.RequestHandler or, com.amazonaws.services.lambda.runtime.RequestStreamHandler implementation
        at io.quarkus.amazon.lambda.deployment.AmazonLambdaProcessor.recordStaticInitHandlerClass(AmazonLambdaProcessor.java:260)
        at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:889)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:255)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2651)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2630)
        at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1622)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1589)
        at java.base/java.lang.Thread.run(Thread.java:1583)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)

We define our handlers in a kind of lib project, e.g.

public abstract class AbstractRequestHandler<T, R> implements RequestHandler<T, R>

We then extend these abstract classes for the executable Lambdas like...
public class GreetingLambda extends AbstractRequestHandler<Person, String>

This worked perfectly up to 3.24.4.
That is probably the change that is causing the problem. #48425

Expected behavior

Tests will succeed and Quarkus lambda application is useable.

Actual behavior

Tests fails and Quarkus lambda application is not useable.

How to Reproduce?

This is a small reproducer project:
https://github.com/dagrammy/lambda-reproducer

- clone repo
- ./gradlew clean build --info
- test will fail

change version to 3.24.4
- ./gradlew clean build --info
- test will succeed

Output of uname -a or ver

Darwin 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:54 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6030 arm6

Output of java -version

OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30)

Quarkus version or git rev

3.25.1

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 8.14

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions