我创建了我的Alexa技能作为AWS Lambda java应用程序,并使用了Alexa Skills Kit中提供的HelloWorld示例。我按照亚马逊网站上给出的所有步骤,包括此处给出的所有步骤Alexa not finding 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与所请求的应用程序通信时出现问题。
有没有人遇到同样的问题?我认为它可能与我的拉链包装有关,所以有人知道正确的包装方式吗?
这是我用于HelloWorld https://docs.google.com/document/d/1DU_-kAOxnhEp_4Lsj6I_LzEN4Di6-4Gmk28OZgc80IA/pub
的代码答案 0 :(得分:1)
您是否首先解决了空指针异常?对不起,如果你有,我说明显了。你能记录请求信封上的数据吗?
答案 1 :(得分:0)
通过从https://github.com/jjaquinta/EchoProofOfConcepts/tree/master/jo.echo.lambda复制HelloWorldSpeechlet,HelloWorldLambda和SpeechletLambda,我能够让Alexa应用程序完全正常工作(我还需要从HelloWorldSpheechlet类中删除所有Overrides)。之后,我只需要按照此处给出的步骤进行操作:Alexa not finding my Skill