Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS SAM not using shade uber jar #1

Open
owenmather opened this issue Sep 5, 2021 · 0 comments
Open

AWS SAM not using shade uber jar #1

owenmather opened this issue Sep 5, 2021 · 0 comments

Comments

@owenmather
Copy link

owenmather commented Sep 5, 2021

The 1.30.0 version of SAM with Java11 does not appear to use the shade uber jar with all libs packaged.

Inspecting the .aws-sam build folder after sam build shows just the base classes present.

ubuntu@ip-192-168-0-253:~/aws-lambda-jenkins-agents/.aws-sam/build/AgentGitBashNodeFunction$ ll
total 20
drwxr-xr-x 4 root root 4096 Sep  5 18:41 ./
drwxr-xr-x 4 root root 4096 Sep  5 18:41 ../
drwxr-xr-x 3 root root 4096 Sep  5 18:41 io/
drwxr-xr-x 2 root root 4096 Sep  5 18:41 lib/
-rw-r--r-- 1 root root  428 Sep  5 18:40 log4j2.xml

S3 bucket contains the same after sam deploy
This results in ClassNotFoundException when invoking the Lambda functions

Caused by: java.lang.ClassNotFoundException: hudson.remoting.jnlp.Main

My workaround was to manually zip and push the contents of the uber jar but maybe there is a way to fix this with pom changes?

aws lambda update-function-code --function-name my-function --zip-file fileb://my-function.zip
root@ip-192-168-0-253:/home/ubuntu/aws-lambda-jenkins-agents/.aws-sam/build/AgentGitBashFunction# sam --version
SAM CLI, version 1.30.0
root@ip-192-168-0-253:/home/ubuntu/aws-lambda-jenkins-agents/.aws-sam/build/AgentGitBashFunction# mvn --version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.11, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.11.0-1016-aws", arch: "amd64", family: "unix"`

Great project btw thank you for making this! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant