-
Notifications
You must be signed in to change notification settings - Fork 569
Description
To help us debug your issue fill in the basic information below using the options provided
Serverless Java Container version: 1.5
Implementations: Spring Boot 2
Framework version: SpringBoot 2.2.7.RELEASE
Frontend service: HTTP API
Deployment method: CloudFormation
Scenario
I'm trying to implement a new application using SpringBoot 2.2.7. But when I use asyncInit()
i get the error Cannot resolve method 'springBootApplication' in 'ServletLambdaContainerHandlerBuilder'
ContainerConfig lambdaContainerConfig = LambdaContainerHandler.getContainerConfig();
lambdaContainerConfig.setInitializationTimeout(20_000);
lambdaContainerConfig.setDefaultContentCharset(StandardCharsets.UTF_8.name());
// For applications that take longer than 10 seconds to start, use the async builder:
long startTime = Instant.now().toEpochMilli();
handler = new SpringBootProxyHandlerBuilder()
.defaultProxy()
.asyncInit()
.springBootApplication(Application.class) // Here I get the error Cannot resolve method 'springBootApplication' in 'ServletLambdaContainerHandlerBuilder'
.buildAndInitialize();
This only happens when I use version 1.5, when I downgrade to 1.4 the error stop showing.
asyncInit()
returns ServletLambdaContainerHandlerBuilder
on version 1.5 but on version 1.4 it returns SpringBootProxyProxyHandlerBuilder
.
Furthermore, why asyncInit(Long startTime)
is deprecated on version greater than 1.5?
Expected behavior
Not showing error Cannot resolve method 'springBootApplication' in 'ServletLambdaContainerHandlerBuilder'