0

I have a very simple AWS Java Lambda function that can be uploaded to an Amazon S3 Instance and successfully run. My code is based on an Eclipse workspace documented by this tutorial. Now I am trying to setup debugging for my Java Lambda function. For that, I am following this tutorial called "AWS Toolkit for Eclipse: Locally Debug Your Lambda Functions and Amazon API Gateway Using AWS SAM Local". It instructs me to install Docker, AWS SAM Local and AWS Toolkit for Eclipse. I have successfully installed all the pre-requisites. Now I am able to run my Lambda function in the Amazon Cloud servers with the context menu item (right click in the source) "AWS Lambda/Run function on Aws Lambda.."

So far so good. But when I choose the menu item "AWS Lambda/Run on AWS SAM Local" things do not work. The build occurs succesfully, the unit tests pass, but running under the debugger fails. I get the following eror details. This occurs for any AWS Lambda java project I create. Can anyone help me diagnose this problem. What part of my setup is incorrect?

Update

After further investigation, it may be the case that the null pointer exception is caused by the lack of a "serverless.template" file in the project. Because creation of an empty one makes the null pointer exception go away but I am on to the next error. So maybe my new challenge is to figure out what the contents of serverless.template are supposed to be for a Lambda function. And I'm not sure why the AWS tutorials do not address this very well.

enter image description here

Rob Gorman
  • 3,502
  • 5
  • 28
  • 45
  • please include the class `SamLocalDelegate` where the null pointer happens – scigs May 04 '18 at 18:12
  • Sorry but I don't understand your comment. The source code that I"m using currently is exactly the aws tutorial code in the link. The exeception doesn't occur in my source. It occurs somehere in the framwork. – Rob Gorman May 04 '18 at 18:25

0 Answers0