Skip to content

ClassNotFoundException when running on AWS (Lambda) #349

@arsalans

Description

@arsalans
  • Framework version: aws-serverless-java-container-springboot2 V1.5
  • Implementations: Spring Boot

Scenario

When running this project in AWS, it is giving me Class not found when I invoke the ping request. Note, locally on IntelliJ IDE (using Tomcat) I can run this without any issues.

Class not found: com.iarchitect.iot.ifttt.handler.StreamLambdaHandler: java.lang.ClassNotFoundException
java.lang.ClassNotFoundException: com.iarchitect.iot.ifttt.handler.StreamLambdaHandler
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	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)

Expected behavior

API responds with Pong.

Actual behavior

AWS lambda runtime throwing class not found exception.

Steps to reproduce

Deploy this project CallBackService, invoke the ping request.

Full log output

START RequestId: 77a311cf-19ec-47b8-a73d-988599cc5882 Version: $LATEST
Class not found: com.iarchitect.iot.ifttt.handler.StreamLambdaHandler: java.lang.ClassNotFoundException
java.lang.ClassNotFoundException: com.iarchitect.iot.ifttt.handler.StreamLambdaHandler
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	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)
END RequestId: 77a311cf-19ec-47b8-a73d-988599cc5882

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions