I am trying to follow the AWS Lambda Java example: http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-deployment-pkg.html#with-s3-example-deployment-pkg-java
Created the new class LambdaFunctionHandler
to stick in the S3 image modifying lambda code. Added aws-lambda-java-core
1.0.0, aws-lambda-java-events
1.0.0, maven-shade-plugin
2.4.3, and aws-java-sdk-core
1.11.0 to maven dependencies. Created jar, and got an error after uploading and and testing the lambda.
The following error appears:
START RequestId: 9b800497-52c2-11e6-a2c2-416f188f3ed0 Version: $LATEST
Error loading class LambdaFunctionHandler: com/amazonaws/services/s3/AmazonS3: class java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: com/amazonaws/services/s3/AmazonS3
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
Caused by: java.lang.ClassNotFoundException: com.amazonaws.services.s3.AmazonS3
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 2 more
I used those version numbers because other answers seemed to reference those specific versions.
Just to make sure I wasn't just using maven incorrectly, I used the AWS plugin for Eclipse to create an AWS Lambda project, and still resulted in the same error.