与 Alexa 的意外通信问题

Unexpected Communication Issue with Alexa

我将我的 Alexa 技能创建为 AWS Lambda java 应用程序,并使用了 Alexa 技能套件中提供的 HelloWorld 示例。我遵循了亚马逊网站上给出的所有步骤,包括我在亚马逊论坛页面上找到的此处 . Since Amazon doesn't fully give instructions at this point to use Lambda with java I followed the steps given in this tutorial https://github.com/jjaquinta/EchoProofOfConcepts/tree/master/jo.echo.lambda 给出的所有步骤。当我 运行 Lambda 中的代码时,它接受它但仅将其显示为执行结果:

{
"version": "1.0",
"sessionAttributes": {}
}

并为 Alexa 启动会话请求获取以下日志输出:

START RequestId: 1e8a753b-37a5-11e5-bad6-6df6c6d7bdc9
SpeechletLambda init
warn:No timestamp tolerance has been configured, disabling timestamp verification
SpeechletLambda done init
Handling request
0 [main] WARN com.amazon.speech.speechlet.authentication.ApplicationIdVerifier  - Application ID verification has been disabled, allowing request for application ID amzn1.echo-sdk-ams.app.[unique-value-here]
warn:Timestamp verification has been disabled, allowing request request5678 with timestamp null
error:Exception occurred in speechlet 
java.lang.NullPointerException
jo.echo.lambda.utils.SpeechletLambda.handleRequest(SpeechletLambda.java:119)
hello.HelloWorldLambda.handleRequest(HelloWorldLambda.java:38)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:497)
lambdainternal.EventHandlerLoader$StreamMethodRequestHandler.handleRequest(EventHandlerLoader.java:494)
lambdainternal.EventHandlerLoader.call(EventHandlerLoader.java:832)
lambdainternal.AWSLambda.startRuntime(AWSLambda.java:223)
lambdainternal.AWSLambda.<clinit>(AWSLambda.java:56)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:348)
lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:93)
END RequestId: 1e8a753b-37a5-11e5-bad6-6df6c6d7bdc9
REPORT RequestId: 1e8a753b-37a5-11e5-bad6-6df6c6d7bdc9  Duration: 2231.45 ms        
Billed Duration: 2300 ms    Memory Size: 512 MB    Max Memory Used: 78 MB

当我用回声尝试技能时,我得到一个 "Unexpected Communication Issue": Request Identifier:amzn1.echo-api.request.173c5d6c-8e97-493c-9efd-beb88cffd82f 有一个问题与请求的应用程序通信。

有没有人运行遇到同样的问题?我想这可能与我的 zip 包装有关,所以有人知道正确的包装方式吗?

这是我用于 HelloWorld 的代码 https://docs.google.com/document/d/1DU_-kAOxnhEp_4Lsj6I_LzEN4Di6-4Gmk28OZgc80IA/pub

你先解决空指针异常了吗?对不起,如果你有,我说的是显而易见的。您可以在请求信封上记录传入的数据吗?

通过从此处复制 HelloWorldSpeechlet、HelloWorldLambda 和 SpeechletLambda,我能够让 Alexa 应用程序完全运行 https://github.com/jjaquinta/EchoProofOfConcepts/tree/master/jo.echo.lambda (I also needed to remove all Overrides from the HelloWorldSpheechlet class). After that I just needed to follow the steps given here: