You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After manually migrating a spring boot App to Lambda, or by downloading the springboot2 sample and running "sam deploy --guided", a regular Lambda gets deployed successfully on AWS. When testing and running the lambda, the result though is always a ClassNotFoundException.
Expected behavior
The Streamhandler class which is well present in the uploaded artefact is found.
Actual behavior
{
"errorMessage": "Class not found: com.amazonaws.serverless.sample.springboot2.StreamLambdaHandler",
"errorType": "java.lang.ClassNotFoundException"
}
Steps to reproduce
Take the springboot2 sample, run mvn package and then sam deploy --guided and wait for the resources to be created, then test the Lambda function. Note that "sam build" will not work if you only have maven installed.
Full log output
see above
The text was updated successfully, but these errors were encountered:
I looked into it. What is happening is that the template.yml file has the CodeUri property set to the current folder. This means that when you try to deploy it with sam deploy --guided it looks for the compiled application under ./.aws-sam/build/PetStoreFunction. If you mvn clean package manually the output is a zip file under the target folder. I suspect that's the reason I cannot find the class, it uploaded to Lambda the contents of the .aws-sam folder which is empty.
I'll look for a way to make sam build work with maven only.
Scenario
After manually migrating a spring boot App to Lambda, or by downloading the springboot2 sample and running "sam deploy --guided", a regular Lambda gets deployed successfully on AWS. When testing and running the lambda, the result though is always a ClassNotFoundException.
Expected behavior
The Streamhandler class which is well present in the uploaded artefact is found.
Actual behavior
Steps to reproduce
Take the springboot2 sample, run mvn package and then sam deploy --guided and wait for the resources to be created, then test the Lambda function. Note that "sam build" will not work if you only have maven installed.
Full log output
see above
The text was updated successfully, but these errors were encountered: