question

germanov avatar image
germanov asked

Lambda/Alexa Function in Java Cannot be Uploaded via Eclipse

I have built a Java based Alexa Lambda function using the Alexa Skills Kit and have had great success until today. Now I find I cannot change my request handler in configuration from the Lambda function configuration options. I get this error "There was no uploaded file or code found in the editor to be saved." I need to be able to change the handler to get my Alexa function to run. I use the SpeechletRequestStreamHandler interface but the AWS explorer in Eclipse wouldn't upload the code to AWS unless I have a class defined that inherits from the RequestHandler class. Just having a SpeechletRequestStreamHandler interface wasn't enough for the "Upload function to AWS Lambda" option. Without a dummy RequestHandler I get a message from the Eclipse plugin that says "No Lambda function handler class is found in the project. You need to have at least one concrete class that implements the com.amazonaws.services.lambda.runtime.RequestHandler interface". That seems like a pretty big bug. So to work around I added a RequestHandler class with a handleRequest method to my Java code and I could upload to AWS. When I did this the Lambda handler in AWS pointed to the dummy handler method. I then could go into the Lambda configuration for my function and change my handler to use my SpeechletRequestStreamHandler and all worked great... until today. Something changed and now if I try to change the handler I get that no uploaded fine or code found message and I cannot change my handler. So basically if you use the examples in Eclipse they don't actually work and there isn't a workaround that I can think of except to try to find a way to do those outside of Eclipse. Message was edited by: germanov Message was edited by: germanov Message was edited by: germanov
alexa skills kitdebugging
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

jjaquinta avatar image
jjaquinta answered
I only got that problem when I generated the project. So I let it generate it the way it wanted, then I went back and changed it to what I wanted. I don't think I've ever got Lambda upload to work. I just export it as a jar file (you have to make sure the jar structure is correct) and upload it via the web site UI. I wrote some instructions on this in the EchoProofOfConcepts project: https://github.com/jjaquinta/EchoProofOfConcepts/tree/master/jo.echo.lambda And there is a bit more detail on it in my book: http://www.amazon.com/How-Program-Amazon-Echo-Development-ebook/dp/B011J6AP26
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.