Now I am developing a java lambda function and testing on the function, but there is an issue:
the test case start session or close session works fine, but the discovery directive doesn't work, and the exception information is (I am using the AWS LWA authentication, and the ask-sdk version is : 2.5.2):
java.lang.NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException
at com.amazon.ask.Skill.invoke(Skill.java:74)
at com.amazon.ask.Skill.invoke(Skill.java:64)
at com.amazon.ask.SkillStreamHandler.handleRequest(SkillStreamHandler.java:66).
and also when the discovery directive comes from my skill, it print NullPointerException as above,here are my lambda test samples:
<<=======start session(function test OK)====>>
{
"version": "1.0",
"session": {
"new": true,
"sessionId": "amzn1.echo-api.session.123456789012",
"application": {
"applicationId": "amzn1.ask.skill.0ave7bda-681c-4518-7732-13kds1bc1842"
},
"user": {
"userId": "amzn1.ask.account.testUser"
},
"attributes": {}
},
"context": {
"AudioPlayer": {
"playerActivity": "IDLE"
},
"System": {
"application": {
"applicationId": "amzn1.ask.skill.0ave7bda-681c-4518-7732-13kds1bc1842"
},
"user": {
"userId": "amzn1.ask.account.testUser"
},
"device": {
"supportedInterfaces": {
"AudioPlayer": {}
}
}
}
},
"request": {
"type": "LaunchRequest",
"requestId": "caba13a7-ff7c-11e8-8bc3-df2204af35ce",
"timestamp": "2016-10-27T18:21:44Z",
"locale": "en-US"
}
}
This Issues is for alexa-smarthome(Python). If you still have the same issue, please contact us through https://alexa.design/contactus (However we don't provide general coding guidance.)
Now I am developing a java lambda function and testing on the function, but there is an issue: the test case start session or close session works fine, but the discovery directive doesn't work, and the exception information is (I am using the AWS LWA authentication, and the ask-sdk version is : 2.5.2): java.lang.NullPointerException: java.lang.NullPointerException java.lang.NullPointerException at com.amazon.ask.Skill.invoke(Skill.java:74) at com.amazon.ask.Skill.invoke(Skill.java:64) at com.amazon.ask.SkillStreamHandler.handleRequest(SkillStreamHandler.java:66).
and also when the discovery directive comes from my skill, it print NullPointerException as above,here are my lambda test samples: <<=======start session(function test OK)====>> { "version": "1.0", "session": { "new": true, "sessionId": "amzn1.echo-api.session.123456789012", "application": { "applicationId": "amzn1.ask.skill.0ave7bda-681c-4518-7732-13kds1bc1842" }, "user": { "userId": "amzn1.ask.account.testUser" }, "attributes": {} }, "context": { "AudioPlayer": { "playerActivity": "IDLE" }, "System": { "application": { "applicationId": "amzn1.ask.skill.0ave7bda-681c-4518-7732-13kds1bc1842" }, "user": { "userId": "amzn1.ask.account.testUser" }, "device": { "supportedInterfaces": { "AudioPlayer": {} } } } }, "request": { "type": "LaunchRequest", "requestId": "caba13a7-ff7c-11e8-8bc3-df2204af35ce", "timestamp": "2016-10-27T18:21:44Z", "locale": "en-US" } }
<<=======discovery directive(function test NullPointerException====>> { "directive": { "header": { "namespace": "Alexa.Discovery", "name": "Discover", "payloadVersion": "3", "messageId": "1bd5d003-31b9-476f-ad03-71d471922820" }, "payload": { "scope": { "type": "BearerToken", "token": "some-access-token" } } } }
*****And here is my smart home stream handler:
public SmartHomeStreamHandler() { super(getSkill()); log.info("===SmartHomeStreamHandler inited.."); System.out.println("===SmartHomeStreamHandler inited.."); }