1

Steps to reproduce:

  1. mn create-app example.micronaut.complete --features aws-api-gateway-graal
  2. add dependency implementation 'com.amazonaws:aws-java-sdk-sns:1.11.656'
  3. 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
    }
  1. ./sam-local.sh
  2. 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)

ssuperczynski
  • 3,190
  • 3
  • 44
  • 61
  • is there some documentation for doing this in kotlin? I'm trying to pusblish messages to a aws sns topic from my app – yokodev Sep 26 '21 at 00:58

1 Answers1

0

Just add commons-logging dependency to your pom.xml or build.gradle:

/build.gradle:
dependencies {
   .
   ..
   compile 'commons-logging:commons-logging:1.2'
} 
/pom.xml:
...
<dependencies>
   .
   ..
   <dependency>
     <groupId>commons-logging</groupId>
     <artifactId>commons-logging</artifactId>
     <version>1.2</version>
   </dependency>

</dependencies>