Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Error uploading ______.jar: Unable to complete transfer: javax/xml/bind/JAXBException #123

Open
psubrownie opened this issue Oct 10, 2018 · 8 comments
Labels
feature-request New feature or enhancement. May require GitHub community feedback.

Comments

@psubrownie
Copy link

I'm not sure where the first error is but in Eclipse I cannot upload a lambda function. Unclear if its a S3 issue or 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:63) 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:511) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 6 more
session Data:
eclipse.buildId=4.9.0.I20180906-0745 java.version=11 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

@zhangzhx
Copy link
Contributor

Thanks for reporting this issue. Java 11 is not supported by far. The desired Java version is Java 8.

@zhangzhx zhangzhx added the feature-request New feature or enhancement. May require GitHub community feedback. label Feb 13, 2019
@mystygage
Copy link

I also fell into this trap. It would be great if this restriction (use Java 8-10) were visible here or here.

@william-ricaurte-skymate

What is the plan for supporting Java 11? Some IDEs can not upload lambda functions due this issue. (JAXB classes were deprecated)

@zhangzhx
Copy link
Contributor

Hi @william-ricaurte-skymate ,

Thanks for reaching out to us. We are more focused on JetBrains plugins at the moment. The support of Java 11 in Eclipse has a low priority. The AWS Toolkit for JetBrains has fully supported SAM local running/debugging of Java/Python. We recommend SAM users to switch to AWS Toolkit for JetBrains for better support.

If you have reasons why not switching to IntelliJ, can you let us know? Thanks.

@guss77
Copy link

guss77 commented Jul 10, 2019

@zhangzhx - Eclipse is a good IDE with a lot of useful built-in features and a lot of third-party plugins. For my use cases Eclipse is better featured, more configurable, faster and more comfortable as I've been working with it a long time now. It integrates better with my Linux-based operating system (open file dialog boxes see network shares, etc). I also believe their out-of-the-box keyboard shortcuts are superior and I can't get used to the JetBrains way of doing things.

JetBrains is a commercial software with an expensive license - the non-crippled version is $500 for the first year. This is too expensive for a lot of developers and we already pay quite a bit to Amazon for AWS service.

Java 8 is 4 versions behind the current GA version with Eclipse 2019-06 supporting Java 12. Amazon offer support for Java 11 across their entire range of products including the Corretto JDK distribution.

The fix for this issue sounds to be pretty small - just add JAXB as a dependency to the plugin and be done with it.

If Amazon decides not to support Eclipse, just say so and drop this project - stringing us along with "Yes, we support Eclipse - as long as you use this ancient version on this ancient installation" is not OK. Java 8 and Eclipse 4.4 were released in 2014.

@guss77
Copy link

guss77 commented Jul 14, 2019

I have found a workaround for this issue:

  1. Locate a copy of the JAXB jar. After you have used it in a Maven project, you can find one using ls ~/.m2/repository/javax/xml/bind/jaxb-api/*/*[0-9].jar
  2. Run eclipse with the -dev command (See here) followed by the path to the JAXB jar.

The following worked for me:

eclipse -dev $(ls ~/.m2/repository/javax/xml/bind/jaxb-api/*/*[0-9].jar | tail -n1)

@renschler
Copy link

I also fell into this trap. It would be great if this restriction (use Java 8-10) were visible here or here.

it's not clear in the docs that only java 1.8 will work. ("To contribute to the AWS Toolkit for Eclipse, you need to have at least these requirements met."...)

I tried to reinstall eclipse from scratch to see if I could get things to work with corretto 8 but it wouldn't let me, I had to select java-11 or greater during install.
Screen Shot 2020-10-07 at 7 20 47 PM

Then, after install, even when I set eclipse and the project to use corretto8 as the JRE, I hit the same error. Presumably because I wasn't able to select java-8 when I first installed eclipse.
Screen Shot 2020-10-07 at 7 23 12 PM

@gjblajian
Copy link

gjblajian commented Oct 13, 2020

I have found a workaround for this issue:

  1. Locate a copy of the JAXB jar. After you have used it in a Maven project, you can find one using ls ~/.m2/repository/javax/xml/bind/jaxb-api/*/*[0-9].jar
  2. Run eclipse with the -dev command (See here) followed by the path to the JAXB jar.

The following worked for me:

eclipse -dev $(ls ~/.m2/repository/javax/xml/bind/jaxb-api/*/*[0-9].jar | tail -n1)

guss77's suggestion worked for me, but I was not happy launching eclipse from the command prompt, so I added the following entry to the eclipse.ini file then tested uploading to AWS lambda and it worked. I would add that I am still not happy Amazon has not updated the plugin to correct this issue without needing this workaround.

-dev
H:\cust\eclipse\jee-2019-12\plugins\jaxb-api-2.3.1.jar

Note that the entry is before the -vm arg

image

Finally note that the version of java that eclipse is running under is java 14 [eclipse jee 2020-09]
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request New feature or enhancement. May require GitHub community feedback.
Projects
None yet
Development

No branches or pull requests

7 participants