java.lang.ClassNotFoundException: com.example.StreamLambdaHandler
See original GitHub issueDescription:
When executing the spring-boot example:
mvn archetype:generate -DgroupId=my.service -DartifactId=my-service -Dversion=1.0-SNAPSHOT \
-DarchetypeGroupId=com.amazonaws.serverless.archetypes \
-DarchetypeArtifactId=aws-serverless-springboot-archetype \
-DarchetypeVersion=1.1
And running the project (via. sam local start-api --template sam.yaml --debug) results in the following error:
START RequestId: 9e5a7678-5dda-49a2-b244-1337d775ffa2 Version: $LATEST
java.lang.ClassNotFoundException: com.example.StreamLambdaHandler
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
This seems to be an issue specifically with Ubuntu sam/docker (Possibly also with ubuntu version 18.04 specifically). Running the same sam-cli 0.3.0 and docker 18.03.1-ce on OSX works correctly and a response is returned as expected.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Class not found: com.madman.lambda ... - GitHub
Class not found: com.madman.lambda.StreamLambdaHandler: java.lang.ClassNotFoundException #354. Open. anudina opened this issue on Jun 10, ...
Read more >AWS Lambda: class java.lang.ClassNotFoundException
Hello::handleRequest with full class path of your stream handler. For example com.abc.company.app.StreamLambdaHandler::handleRequest; Save ...
Read more >Resolve "ClassNotFoundExeption" errors from Java Lambda ...
The ClassNotFoundException error occurs when a Java runtime loads a class by its fully qualified name, but doesn't locate the class.
Read more >awslabs/aws-serverless-java-container - Gitter
ClassNotFoundException : com.project.customer.StreamLambdaHandler ... Try to use the same unit testing method from the samples to test the invoke in local.
Read more >How to resolve java.lang.ClassNotFoundException in Java ...
In this java tutorial, we will see what is ClassNotFoundException in java, what is real cause of it, and how to fix it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
+1 setup:
Ubuntu: 16.0.4 Docker: 18.03.1-ce Sam: 0.3.0
It works for JS and fails for Java. Rolling back onto Sam 0.2.11 works for Java.
+1 here too on:
Linux Mint 18.1 Cinnamon 64-bit Sam 0.3.0 Docker 18.03.1-ce
This is really slowing down our Java development!
Seems to work okay for JavaScript though