Steps to reproduce:
- mn create-app example.micronaut.complete --features aws-api-gateway-graal
- add dependency implementation 'com.amazonaws:aws-java-sdk-sns:1.11.656'
- modify index() function which was automatically created by mn-cli
@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
I got following error and then function timeout:
Invocation with requestId [21a6b1d0-7697-12b0-f4d8-d15e16954a4c] failed: org.apache.commons.logging.LogFactoryjava.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory at org.apache.commons.logging.LogFactory.class$(LogFactory.java:1021) at org.apache.commons.logging.LogFactory.(LogFactory.java:1674)