我将我的 Alexa 技能创建为 AWS Lambda java 应用程序,并使用了 Alexa Skills Kit 中提供的 HelloWorld 示例。我遵循了亚马逊网站上给出的所有步骤,包括此处给出的所有步骤Alexa not found my Skill。由于亚马逊此时没有完全给出使用 Lambda 和 java 的说明,我按照本教程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$2.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
当我尝试使用 echo 的技能时,我遇到了“意外的通信问题”:请求标识符:amzn1.echo-api.request.173c5d6c-8e97-493c-9efd-beb88cffd82f 与请求的应用程序通信时出现问题。
有没有人遇到同样的问题?我想这可能与我的 zip 包装有关,所以有人知道正确的包装方法吗?
这是我用于 HelloWorld 的代码https://docs.google.com/document/d/1DU_-kAOxnhEp_4Lsj6I_LzEN4Di6-4Gmk28OZgc80IA/pub