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
However, when I try running the newly created project locally through the aws-sam-cli sam local start-api -t sam.yaml command and then hit the /ping endpoint via http://127.0.0.1:3000/ping I get a ClassNotFoundException complaining about the StreamLambdaHandler class.
Running a zipinfo on the jar created by the shade plugin shows all the dependencies (including the StreamLambdaHandler class that it is complaining about) but it didn't have the required global read permissions:
Seeing that, I tried switching out the shade plugin with the maven-assembly-plugin in the pom.xml as follows:
That creates a jar bundled with all the dependencies with the requisite global read permissions:
I then updated the sam.yaml file to point to the correct jar file and tried executing sam local start-api -t sam.yaml again but encountered the same ClassNotFoundException.
I have not changed any other file or configuration that the Maven archetype has set-up.
I am also encountering this same problem on a separate project that I have deployed to AWS Lambda via the aws cloudFormation commands.
Expected behavior
Newly created project using the provided Maven archetype should run OOTB without errors.
Actual behavior
Getting a ClassNotFoundException on the StreamLambdaHandler.
Hey @sisiguo, we really need the aws-sam-cli folks to fix this. However, I think we may switch to Maven's assembly plugin instead of Shade going forward to avoid this.
Scenario
I'm trying to create a new serverless Spring Boot application using the provided Maven archetype and following the instructions here: https://github.com/awslabs/aws-serverless-java-container/wiki/Quick-start---Spring-Boot.
However, when I try running the newly created project locally through the aws-sam-cli
sam local start-api -t sam.yaml
command and then hit the/ping
endpoint via http://127.0.0.1:3000/ping I get aClassNotFoundException
complaining about theStreamLambdaHandler
class.Some googling have checking the created .jar file to ensure it has all dependencies packaged with the requisite global read permissions as mentioned here https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html.
Running a
zipinfo
on the jar created by the shade plugin shows all the dependencies (including theStreamLambdaHandler
class that it is complaining about) but it didn't have the required global read permissions:Seeing that, I tried switching out the shade plugin with the
maven-assembly-plugin
in the pom.xml as follows:That creates a jar bundled with all the dependencies with the requisite global read permissions:
I then updated the
sam.yaml
file to point to the correct jar file and tried executingsam local start-api -t sam.yaml
again but encountered the sameClassNotFoundException
.I have not changed any other file or configuration that the Maven archetype has set-up.
I am also encountering this same problem on a separate project that I have deployed to AWS Lambda via the aws cloudFormation commands.Expected behavior
Newly created project using the provided Maven archetype should run OOTB without errors.
Actual behavior
Getting a
ClassNotFoundException
on theStreamLambdaHandler
.Steps to reproduce
Build project via:
mvn clean install
(from root project directory)Run locally via:
sam local start-api -t sam.yaml
(from root project directory)Attempt to hit
/ping
endpoint in browser via:http://127.0.0.1:3000/ping
Full log output
The text was updated successfully, but these errors were encountered: