Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Implicit java.xml.bind dependency unsatisfied on Java 9 #71

Closed
jamesottaway opened this issue Jan 2, 2018 · 6 comments
Closed

Implicit java.xml.bind dependency unsatisfied on Java 9 #71

jamesottaway opened this issue Jan 2, 2018 · 6 comments

Comments

@jamesottaway
Copy link

I installed Java via brew cask install java which gave me Java 9.

When I tried to clone a VSTS repo it failed, and I found the following stacktrace when running GCM4ML in debug mode:

VsoAzureAuthority::validateCredentials
Fatal error encountered.  Details:
java.lang.Error:    unexpected error
	at com.microsoft.alm.authentication.VsoAzureAuthority.validateCredentials(VsoAzureAuthority.java:214)
	at com.microsoft.alm.authentication.BaseVsoAuthentication.validateCredentials(BaseVsoAuthentication.java:204)
	at com.microsoft.alm.gitcredentialmanager.Program.get(Program.java:322)
	at com.microsoft.alm.gitcredentialmanager.Program.get(Program.java:293)
	at com.microsoft.alm.gitcredentialmanager.Program.access$200(Program.java:63)
	at com.microsoft.alm.gitcredentialmanager.Program$3.call(Program.java:284)
	at com.microsoft.alm.gitcredentialmanager.Program$3.call(Program.java:281)
	at com.microsoft.alm.gitcredentialmanager.Program.innerMain(Program.java:195)
	at com.microsoft.alm.gitcredentialmanager.Program.main(Program.java:123)
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
	at com.microsoft.alm.secret.Credential.contributeHeader(Credential.java:125)
	at com.microsoft.alm.authentication.VsoAzureAuthority.createConnectionDataRequest(VsoAzureAuthority.java:315)
	at com.microsoft.alm.authentication.VsoAzureAuthority.validateCredentials(VsoAzureAuthority.java:199)
	... 8 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
	... 11 more

Turns out you need to specify the --add-modules java.xml.bind flag to include the DatatypeConverter class definition.

I'll leave it up to someone with more current Java experience than mine to find a proper solution to this which won't break people on Java 8…

@K4pt4n
Copy link

K4pt4n commented Jun 5, 2018

For an end user, is there something I can run to get this going? I assume this has to do with needing to turn on the insecure option.

@jamesottaway
Copy link
Author

Follow the manual installation instructions but add --add-modules java.xml.bind to the command when you update the credential.helper config value.

@carlosvin
Copy link

carlosvin commented Jul 3, 2018

@jamesottaway, thanks, that works for me with Java 10:
[credential] helper = !/usr/lib/jvm/java-10-jdk/bin/java --add-modules java.xml.bind -Ddebug=false -Djava.net.useSystemProxies=true -jar /usr/share/java/git-credential-manager-2.0.3.jar

@praveeno
Copy link

it would be great if this --add-modules java.xml.bind can add in README

@novak
Copy link
Contributor

novak commented Sep 13, 2018

This issue should be resolved in the newly released version 2.0.4. There were a few changes made to support Java 9+.

Please let me know if you continue to see an issue.

@jamesottaway
Copy link
Author

Thanks @novak!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants