在以下期间发生内部错误:将代码上传到lambda

时间:2018-10-11 10:47:37

标签: eclipse amazon-web-services eclipse-plugin aws-lambda

将代码上传到lambda时抛出此异常。我尝试过,但没有找到解决方法。

java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
    at com.amazonaws.util.Md5Utils.md5AsBase64(Md5Utils.java:104)
    at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1647)
    at com.amazonaws.eclipse.lambda.upload.wizard.util.UploadFunctionUtil.performFunctionUpload(UploadFunctionUtil.java:95)
    at com.amazonaws.eclipse.lambda.upload.wizard.UploadFunctionWizard.doFinish(UploadFunctionWizard.java:111)
    at com.amazonaws.eclipse.core.plugin.AbstractAwsJobWizard$1.run(AbstractAwsJobWizard.java:35)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException cannot be found by com.amazonaws.eclipse.javasdk_1.11.248
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 6 more

1 个答案:

答案 0 :(得分:0)

确保Eclipse在Java 8上运行。AWSToolkit需要JAXB才能上载到AWS S3,但是JAXB在Java 9和10中已弃用,并且已从Java 11中删除。或11,Eclipse / AWS Toolkit找不到JAXB,您会收到此错误。

您可以通过指定启动时应使用的JVM来解决此问题。有关各种平台的说明,请参见:https://wiki.eclipse.org/Eclipse.ini