Skip to content

SpringBoot application crashes with null pointer error when running locally without SAM local #104

@quantum-fusion

Description

@quantum-fusion

The problem is that this variable is a null value, when running locally with a manifest file.

A manifest file should be added to folder META-INF called MANIFEST.MF in package com.amazonaws.serverless.sample.springboot

The contents of the manifest file MANIFEST.MF should be as follows:
Manifest-Version: 1.0
Main-Class: com.amazonaws.serverless.sample.springboot.Application

The problem with this rest service, is that it creates a NULL value and crashes when running the Application.java locally within Intellij.

https://github.com/awslabs/aws-serverless-java-container/blob/06756285a14c3917a1799c85213d0c4c9fdb449f/samples/springboot/pet-store/src/main/java/com/amazonaws/serverless/sample/springboot/controller/PetsController.java#L48

Question, what significance does the Principal variable have? If it runs locally, and that System.out.println has been deleted, the program runs with flying colors as expected.

Does the AWS gateway require a variable Principal as an argument, and if so, what purpose does it serve?

Note: I have been able to run without reference to that variable, and have deleted it, and added a manifest file and everything runs great locally with SpringBoot, and also with SAM local.

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