AWS Lambda:类java.lang.ClassNotFoundException [英] AWS Lambda: class java.lang.ClassNotFoundException

查看:227
本文介绍了AWS Lambda:类java.lang.ClassNotFoundException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此消息,但不知道如何解决.在线搜索并尝试实施他们的建议,但还没有运气.

I am getting this message and I have no idea how to resolve it. Searched online and tried to implement their suggestion, but no luck yet.

我基本上遵循了此链接中指定的说明- http://docs.aws.amazon .com/toolkit-for-eclipse/v1/user-guide/lambda-tutorial.html

I basically followed the instructions specified in this link - http://docs.aws.amazon.com/toolkit-for-eclipse/v1/user-guide/lambda-tutorial.html

但是,我没有使用嵌入在Eclipse中的AWS管理控制台上传项目,而是尝试创建项目的zip并将其上传到AWS Web控制台.

But instead of uploading the project using the AWS Management Console embedded in Eclipse, I tried to create a zip of my project and upload it to the AWS web console.

下面是我的项目的结构-

Below is structure of my project -

就是这样!我在这里尝试做的事情没有幻想.这只是Lambda中的HelloWorld示例.

That is it!! There is nothing fancy that I am trying to do here. It is just a HelloWorld example in Lambda.

现在,这就是我创建zip文件的方式,这在Eclipse中非常简单-

Now, this is how I am creating the zip file, which is pretty straight forward in Eclipse -

一旦创建了zip,我便将其上传到AWS Web Console的代码"选项卡下-

Once the zip is created I uploaded it to AWS Web console under the code tab -

配置"标签如下所示-

The Configuration tab looks something like this -

现在,当我单击测试"按钮时,无法找到example.Hello类.

Now when I am clicking the Test button it is unable to find the example.Hello class.

为什么Lambda函数很难找到此类?任何人都可以建议此执行中可能出了什么问题吗?

How come it is becoming so difficult for the Lambda Function to find this class? Can anyone suggest what possibly is going wrong in this execution??

如果有帮助,还附加了log语句-

Also attached the log statement, in case it helps -

推荐答案

请注意,RequestHandler接口的通用类型不同于默认类型:

Note that the generic type of your RequestHandler interface is different from the default one :

默认值:public class Hello implements RequestHandler<Object, String>

您的用户:public class Hello implements RequestHandler<String, String>

给出ClassNotFoundException的原因

The reason why it is giving ClassNotFoundException

这篇关于AWS Lambda:类java.lang.ClassNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆