Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Lambda can't parse zipped jars

When I upload a .zip-file containing a .jar-artifact to an AWS Lambda function, the artifact isn't parsed correctly. However, if the artifact is uploaded directly without being zipped, it works as intended.

The error I get in the lambda console when testing a zipped function is the following:

{
  "errorMessage": "Class not found: foo.bar.Class",
  "errorType": "java.lang.ClassNotFoundException"
}

I must repeat that I am absolutely certain that the artifact when unzipped does not display this behavior. It only happens when the artifact is zipped.

like image 246
Ben Avatar asked Oct 22 '25 16:10

Ben


1 Answers

It appears that AWS Lambda simply can't parse zipped Java artifacts. I couldn't find any workaround, so the solution is to not zip your .jars in the first place.

like image 166
Ben Avatar answered Oct 25 '25 04:10

Ben