- Newest
- Most votes
- Most comments
Hello Mihai,
I understand that you are getting following error, when trying to upload lambda function code using AWS Toolkit for Eclipse.
“ An internal error occurred during: "Uploading function code to Lambda": javax/xml/bind/JAXBException”
For newer version of Eclipse, it is likely that Java 11 is being used. AWS Toolkit for Eclipse prerequisite need use of Java 1.8 (https://docs.aws.amazon.com/toolkit-for-eclipse/v1/user-guide/setup-install.html).
AWS toolkit looks for JAXB class, in order to upload the code to S3 bucket, which is only available in Java 8. This class is deprecated in Java 9 & 10, and removed from Java 11.
As a workaround, you can use Java 1.8 with Eclipse. You can ensure this by specifying the JVM that Eclipse should use on a startup (https://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM).
There are related Github issues, created with official aws-toolkit-eclipse SDK team:
Please feel free to reach out directly to (aws-toolkit-eclipse) (https://github.com/aws/aws-toolkit-eclipse) team, for further insight into this issue.
Hello Mihali,
The JAXB was deprecated in Java 9 & 10, and removed from Java 11. If your'e running Eclipse under Java 9, 10, or 11, Eclipse/AWS Toolkit won't find JAXB and you'll get this error.
As an alternative you can mitigate the issue by using alternate versions of the Java EE technologies. Add the Maven dependencies that contain the classes you need:
For reference, If you are using the Java 11 runtime you can add the JAXB class by using the following maven dependency:
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>4.0.0</version>
<scope>runtime</scope>
</dependency>
[+] (https://search.maven.org/artifact/jakarta.xml.bind/jakarta.xml.bind-api) (https://search.maven.org/artifact/com.sun.xml.bind/jaxb-impl)
Kindly, test the above mentioned insights in your testing environment and let us know if the above insights helped you to mitigate the issue.
There is an open issue on the GitHub describing the same (https://github.com/aws/aws-toolkit-eclipse/issues/217) feel free to add your queries on the on-going issue.
Hello,
As I specified in main question, the archive is built and stored on local drive. So, there is no need for some extra maven configurations inside the application code, that will not affect the wizard that is building and deploying the package in AWS S3. I already did this kind of attempts before writing this question, but no results. I tried this kind of maven dependency in application , but did you have something else in mind ? Where did you intend to add those configurations ?
Have a good day, Mihai
Hello, It would be nice if your configurations were related to Eclipse settings because newer versions of Eclipse require Java 11 with this argument in eclipse.ini: -Dosgi.requiredJavaVersion=11 Thank you, Mihai
Relevant content
- asked 2 years ago
- asked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated a year ago
Hello,
This seams to work. I changed the eclipse.ini and make the deploy. Eclipse did not returned any more the JAXBException and the package was deployed in S3 and installed in Lambda, even if there was another error in Eclipse that I added also here in re:Post in another thread.
Thanks a lot, Mihai