-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPE with AWS Lambda and SpringBoot starting multiple times #291
Comments
Hi @MounicaRamini, couple of things that could be going on:
Hope this helps. |
@sapessi What does the below error mean ?
The arn value had assumed role with my empid at the end. Does that mean, am not allowed to perform anything there ? What does null mean here ? |
It's not an error, just an INFO log. Having said that, I can't seem to find that log line anywhere in the code. Can you share a few log lines around it? |
Hi @sapessi I haven't added anywhere in the code to log that INFO. It must be from internal jars. I have taken that request format while triggering API Gateway, and started to test it out in AWS Lambda Console to check the solution because of API timeout issues. Also, at the end of errors, I see it forming an endpoint in the format "POST /path/resourceHTTP/1.1", Is is correct ?
But on API gateway, the way endpoint is
|
The first |
Could you please share me a sample event to test please |
It should look something like this (make sure to adjust path/method/headers to something that suites your app): {
"resource":"/helloworld",
"path":"/helloworld",
"httpMethod":"GET",
"headers": {
"Accept":"*/*",
"content-type":"application/json",
"Host":"r275xc9bmd.execute-api.us-east-1.amazonaws.com",
"User-Agent":"curl/7.64.0",
"X-Amzn-Trace-Id":"Root=1-1a2b3c4d-a1b2c3d4e5f6a1b2c3d4e5f6",
"X-Forwarded-For":"72.21.198.64",
"X-Forwarded-Port":"443",
"X-Forwarded-Proto":"https"
},
"multiValueHeaders":{
"Accept":["*/*"],
"content-type":["application/json"],
"Host":["r275xc9bmd.execute-api.us-east-1.amazonaws.com"],
"User-Agent":["curl/0.0.0"],
"X-Amzn-Trace-Id":["Root=1-1a2b3c4d-a1b2c3d4e5f6a1b2c3d4e5f6"],
"X-Forwarded-For":["11.22.333.44"],
"X-Forwarded-Port":["443"],
"X-Forwarded-Proto":["https"]
},
"queryStringParameters":{
"city":"Seattle",
"name":"John"
},
"multiValueQueryStringParameters":{
"city":["Seattle"],
"name":["John"]
},
"pathParameters":null,
"stageVariables":null,
"requestContext":{
"resourceId":"3htbry",
"resourcePath":"/helloworld",
"httpMethod":"POST",
"extendedRequestId":"a1b2c3d4e5f6g7h=",
"requestTime":"20/Mar/2019:20:38:30 +0000",
"path":"/test/helloworld",
"accountId":"123456789012",
"protocol":"HTTP/1.1",
"stage":"test",
"domainPrefix":"r275xc9bmd",
"requestTimeEpoch":1553114310423,
"requestId":"test-invoke-request",
"identity":{
"cognitoIdentityPoolId":null,
"accountId":null,
"cognitoIdentityId":null,
"caller":null,
"sourceIp":"test-invoke-source-ip",
"accessKey":null,
"cognitoAuthenticationType":null,
"cognitoAuthenticationProvider":null,
"userArn":null,
"userAgent":"curl/0.0.0","user":null
},
"domainName":"r275xc9bmd.execute-api.us-east-1.amazonaws.com",
"apiId":"r275xc9bmd"
},
"body": null,
"isBase64Encoded":false
} If you are building unit tests, we include a request builder object. Check our examples here |
@sapessi Thanks. So, there might be something wrong in the request that am trying to send and test it out ? Just wanted an input |
@sapessi Thank You so much for patiently answering everything. It worked, I did make changes to Request Format.It brings up records now thank you so much |
The event you were sending was correct in structure since the library was able to read it. However, there seem to be something broken in the value of the |
Framework version: XX
Implementations: Spring Boot / Lambda
Scenario
NPE when invoking Lambda Function in AWS Lambda Console and Spring Boot starting multiple times
Expected behavior
Should be inserting and fetching records from database when Lambda is invoked
Actual behavior
Throws below error, when Lambda is executed by using AWS Lambda Test Events
Full log output
Error Message on AWS Lambda Cosole :
Full log output on Cloud Watch
AWS POM Dependencies
SpringBoot Lambda Handler Class
Application class
Test Data in JSON for LAMBDA-PROXY event. Is there any other Test Event format that I can use to test AWS Lambda Function on AWS Lambda Console
This message also displays on CloudWatch, despite of giving headers
@sapessi Can you please help me with this issue
The text was updated successfully, but these errors were encountered: