alexa / alexa-skills-kit-sdk-for-java

The Alexa Skills Kit SDK for Java helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
http://developer.amazon.com/ask
Apache License 2.0
816 stars 746 forks source link

No public method named found #68

Closed manishdugaya closed 6 years ago

manishdugaya commented 7 years ago

While tesing lamda function getting below error "errorMessage": "No public method named HelloWorldSpeechletRequestStreamHandler with appropriate method signature found on class class helloworld.HelloWorldSpeechletRequestStreamHandler"

Thanks

ghost commented 6 years ago

Is your StreamHandler class called exactly HelloWorldSpeechletRequestStreamHandler that you specified under Handler in Function code section in Lambda? If so, is the path the same in your project as helloworld.HelloWorldSpeechletRequestStreamHandler?

ghost commented 6 years ago

Closing due to inactivity but please feel free to reopen if this issue persists!

bearbearcow commented 6 years ago

same error. did anyone make it work?

Chris-Liao commented 6 years ago

@bearbearcow hi, can you provide more details? What SDK are you using? How did you configure your lambda function and skill? Or you can provide your Stream Handler code here so that we can help you.

Looks like you are referring to the old version SDK. We have V2 SDK Hello World sample here. For this example, in lambda function - Handler, it's helloworld.HelloWorldStreamHandler.

Hope it helps. Feel free to re-open this issue if you have any questions.

bearbearcow commented 6 years ago

Hi, thanks so much for your advises! I got problem when testing helloworld sample in ask sdk. I'm using alexa-skills-kit-sdk-for-java/samples/helloworld for testing, it's the latest version i download from github. I havn't change any code in helloworld sample. and build the jar package wihth command : "mvn org.apache.maven.plugins:maven-assembly-plugin:2.6:assembly -DdescriptorId=jar-with-dependencies package" after that i upload target jar file "helloworld-1.0-jar-with-dependencies.jar" to lambda。

In Lambda function - Handler,i have tried to fill some handlers, but they didn't pass。 Here is the handler i filled in Lambda function handler and the test results: 1.com.amazon.ask.helloworld.HelloWorldStreamHandler test result: { "errorMessage": "2018-09-13T01:36:23.210Z 6922c86e-b6f5-11e8-854d-01b6da6a9a5d Task timed out after 3.00 seconds" }

2.com.amazon.ask.helloworld.HelloWorldStreamHandler::HelloWorldStreamHandler test result: { "errorMessage": "No public method named HelloWorldStreamHandler with appropriate method signature found on class class com.amazon.ask.helloworld.HelloWorldStreamHandler" }

3.helloworld.HelloWorldStreamHandler test result: { "errorMessage": "Class not found: helloworld.HelloWorldStreamHandler", "errorType": "java.lang.ClassNotFoundException" }

4.helloworld.HelloWorldStreamHandler::HelloWorldStreamHandler test result: { "errorMessage": "Class not found: helloworld.HelloWorldStreamHandler", "errorType": "java.lang.ClassNotFoundException" }

the attachement is my helloworld jar package. How can i fix this problem?Look forward to your replay.


Best Regards!

------------------ 原始邮件 ------------------ 发件人: "Chris-Liao"notifications@github.com; 发送时间: 2018年9月13日(星期四) 凌晨1:59 收件人: "alexa/alexa-skills-kit-sdk-for-java"alexa-skills-kit-sdk-for-java@noreply.github.com; 抄送: "Skyline"395557327@qq.com; "Mention"mention@noreply.github.com; 主题: Re: [alexa/alexa-skills-kit-sdk-for-java] No public method namedfound (#68)

@bearbearcow hi, can you provide more details? What SDK are you using? How did you configure your lambda function and skill? Or you can provide your Stream Handler code here so that we can help you.

Looks like you are referring to the old version SDK. We have V2 SDK Hello World sample here. For this example, in lambda function - Handler, it's helloworld.HelloWorldStreamHandler.

Hope it helps. Feel free to re-open this issue if you have any questions.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

bearbearcow commented 6 years ago

hi again, in lambda function - Handler, i filled "com.amazon.ask.helloworld.HelloWorldStreamHandler",the test result is: { "errorMessage": "java.lang.NullPointerException", "errorType": "java.lang.NullPointerException", "stackTrace": [ "com.amazon.ask.Skill.getApiConfiguration(Skill.java:100)", "com.amazon.ask.Skill.invoke(Skill.java:79)", "com.amazon.ask.Skill.invoke(Skill.java:64)", "com.amazon.ask.SkillStreamHandler.handleRequest(SkillStreamHandler.java:66)" ] }

How can i fix this problem,look forward to your reply.


Best Regards!

------------------ 原始邮件 ------------------ 发件人: "Chris-Liao"notifications@github.com; 发送时间: 2018年9月13日(星期四) 凌晨1:59 收件人: "alexa/alexa-skills-kit-sdk-for-java"alexa-skills-kit-sdk-for-java@noreply.github.com; 抄送: "Skyline"395557327@qq.com; "Mention"mention@noreply.github.com; 主题: Re: [alexa/alexa-skills-kit-sdk-for-java] No public method namedfound (#68)

@bearbearcow hi, can you provide more details? What SDK are you using? How did you configure your lambda function and skill? Or you can provide your Stream Handler code here so that we can help you.

Looks like you are referring to the old version SDK. We have V2 SDK Hello World sample here. For this example, in lambda function - Handler, it's helloworld.HelloWorldStreamHandler.

Hope it helps. Feel free to re-open this issue if you have any questions.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Chris-Liao commented 6 years ago

@bearbearcow hi I can't see your attachment on github, but you are on the right track, in Lambda function - Handler: com.amazon.ask.helloworld.HelloWorldStreamHandler.

I just ran a end to end Hello World skill test and also test on lambda, everything looks good.

  1. I suspect you used a wrong format json input when test on lambda. You can use Alexa Start Session Event Template. It should execute successfully.

  2. You can also test on developer console , which provides you a better user-friendly testing UI.

Hope it helps.