- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
It looks like helloworld.App class has not been packaged as part of your Java Lambda function. There aren't any Java examples in the Github repo you've specified, but to try and explain the problem.
The JVM attempts to load classes from the locations in the classpath, these locations can be separate JAR files or physical directories. If you had a directory of C:\mycode\myjavaapp and attempted to load a class called helloworld.App then the JVM will look under C:\mycode\myjavaapp\helloworld for a file called App.class. You can specify multiple locations in your classpath using this syntax "C:\mycode\myjavaapp;C:\mycode\libs\sharedcode.jar;C:\mycode\libs\someotherstuff.jar"
Now coming back to your Lambda function, the reason it works locally is that the file for the class helloworld.App exists on your local machine, under whatever path that may be. Now when you deploy the function you need to ensure that the file for helloworld.App can still be found in the files of the deployed Lambda function.
Hope that helps, there is a great article here on the AWS knowledge center that goes through some debugging steps - https://aws.amazon.com/premiumsupport/knowledge-center/lambda-troubleshoot-java-classnotfound/
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor 2 Jahren