1

我有一个 Spring Boot 应用程序,在本地执行时启动没有问题。我想通过 AWS Lambda 运行应用程序。我使用了https://github.com/awslabs/aws-serverless-java-container并添加了本示例中描述的相应代码:https ://keyholesoftware.com/2018/04/26/aws-lambda-with -弹簧引导/

问题是,当在 AWS 中作为 Lambda 运行时,它会引发一个无法找到上下文的异常:

Caused by: java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:84)
at com.amazonaws.serverless.proxy.spring.SpringBootLambdaContainerHandler.initialize(SpringBootLambdaContainerHandler.java:181)
at com.amazonaws.serverless.proxy.spring.SpringBootLambdaContainerHandler.getAwsProxyHandler(SpringBootLambdaContainerHandler.java:77)
4

0 回答 0