重现步骤:
- mn create-app example.micronaut.complete --features aws-api-gateway-graal
- 添加依赖实现 'com.amazonaws:aws-java-sdk-sns:1.11.656'
- 修改 mn-cli 自动创建的 index() 函数
@Get("/ping")
public String index() { //automatically created by mn-cli
AmazonSNS sns = AmazonSNSClient.builder() //Create SNS client
.withRegion("ap-south-1").build(); //Specify Region
return "{\"pong\":true, \"graal\": true}";// to check whether function is working
}
- ./sam-local.sh
- http://localhost:3000/ping
我收到以下错误,然后函数超时:
使用 requestId [21a6b1d0-7697-12b0-f4d8-d15e16954a4c] 调用失败:org.apache.commons.logging.LogFactoryjava.lang.NoClassDefFoundError:org.apache.commons.logging.LogFactory 中的 org.apache.commons.logging.LogFactory。 org.apache.commons.logging.LogFactory.(LogFactory.java:1674) 上的类 $(LogFactory.java:1021)