gpt4 book ai didi

java - AWS lambda Java : Lambda was not able to unzip the file

转载 作者:行者123 更新时间:2023-11-30 07:46:09 25 4
gpt4 key购买 nike

我正在尝试将 Java 与 AWS Lambda 结合使用。我创建了一个包含所有依赖项的 jar 文件(使用 maven-assembly-plugin)。上传后,我无法调用 lambda。我收到错误 Calling the Invoke API failed with message: Lambda was not able to unzip the file。 jar 文件为 11 MB。我可以使用 java -jar

执行 jar

最佳答案

maven-assemply-plugin 需要被告知输出一个 zip,而不是一个 jar。 (我什至不知道有什么不同!)

将其添加到其配置中:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
...
<configuration>
...
<formats>
<format>zip</format>
</formats>
</configuration>
</plugin>

关于java - AWS lambda Java : Lambda was not able to unzip the file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50910812/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com