Test event is expecting json and throwing parsing error.we cant pass only name as it is not valid json
{"key":"name"}
This is throwing
{
"errorMessage": "An error occurred during JSON parsing",
"errorType": "java.lang.RuntimeException",
"stackTrace": [],
"cause": {
"errorMessage": "com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@710726a3; line: 1, column: 1]",
"errorType": "java.io.UncheckedIOException",
"stackTrace": [],
"cause": {
"errorMessage": "Can not deserialize instance of java.lang.String out of START_OBJECT token\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@710726a3; line: 1, column: 1]",
"errorType": "com.fasterxml.jackson.databind.JsonMappingException",
"stackTrace": [
"com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)",
"com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:857)",
"com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:62)",
"com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:11)",
"com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1511)",
"com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1102)"
]
}
}
}
Can you please let me know, in which recipe and step, you got this error?
his error i got while testing first receipe only. i.e Your First AWS Lambda
6. We can test the uploaded JAR:
1. Select Configure test events from the Select a test
event dropdown next to the Test button.
2. Select Create new test event.
3. Give a name for the event: MyHelloWorldTest.
4. Within the JSON request content area, just specify your name, such
as Heartin.
5. Click on Create. If successful, it will take you to the
myHelloWorldLambda function page.
6. From the myHelloWorldLambda function page, select the test event,
MyHelloWorldTest, next to the Test button, and click the Test button.
7. You should see the message Hello Heartin after expanding the
details of execution result.
One more point , where awscli gets installed , aws command is not working on windows , i can see i need to add path but not able to see folder under users
4th step in the recipe is
"Within the JSON request content area, just specify your name, such as Heartin".
So you have to add only your name in the content area of the configured test event. For example : "Rajni"
Add your name in the above format. Save the test event and click 'Test' on the main page and you will see the output
Thanks its working , I was trying to give name as {"test"} but as you mentioned it should be with brackets.
I have added "C:\Users\<username>\AppData\Roaming\Python\Python35\Scripts" path in path environment variable ,after that aws command started working.
After running aws configure , i can see .aws folder is created under "C:\Users\<username>" path