Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoClassDefFoundError: org/ietf/jgss/GSSException when running with java11 #105

Open
holgerbrandl opened this issue Jan 29, 2020 · 4 comments

Comments

@holgerbrandl
Copy link

jcabi-aether is used to resolve dependencies in https://github.com/holgerbrandl/kscript.
However, currently it is not possible to use it with java11 (see kscripting/kscript#239), because when resolving dependencies the following exception is being thrown:

Resolving "org.openjsse:openjsse:1.1.0"...Exception in thread "main" java.lang.NoClassDefFoundError: org/ietf/jgss/GSSException
	at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.<clinit>(NettyAsyncHttpProvider.java:177)
	at org.sonatype.aether.connector.async.AsyncRepositoryConnector.getDefaultProvider(AsyncRepositoryConnector.java:246)
	at org.sonatype.aether.connector.async.AsyncRepositoryConnector.getProvider(AsyncRepositoryConnector.java:241)
	at org.sonatype.aether.connector.async.AsyncRepositoryConnector.<init>(AsyncRepositoryConnector.java:154)
	at org.sonatype.aether.connector.async.AsyncRepositoryConnectorFactory.newInstance(AsyncRepositoryConnectorFactory.java:106)
	at org.sonatype.aether.impl.internal.DefaultRemoteRepositoryManager.getRepositoryConnector(DefaultRemoteRepositoryManager.java:346)
	at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:453)
	at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
	at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:281)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
	at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:191)
	at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:333)
	at com.jcabi.aether.Aether.fetch(Aether.java:228)
	at com.jcabi.aether.Aether.resolve_aroundBody2(Aether.java:180)
	at com.jcabi.aether.Aether$AjcClosure3.run(Aether.java:1)
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
	at com.jcabi.aspects.aj.MethodLogger.wrap(MethodLogger.java:208)
	at com.jcabi.aspects.aj.MethodLogger.ajc$inlineAccessMethod$com_jcabi_aspects_aj_MethodLogger$com_jcabi_aspects_aj_MethodLogger$wrap(MethodLogger.java:1)
	at com.jcabi.aspects.aj.MethodLogger.wrapClass(MethodLogger.java:136)
	at com.jcabi.aether.Aether.resolve(Aether.java:177)
	at com.jcabi.aether.Aether.resolve_aroundBody0(Aether.java:163)
	at com.jcabi.aether.Aether$AjcClosure1.run(Aether.java:1)
	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
	at com.jcabi.aspects.aj.MethodLogger.wrap(MethodLogger.java:208)
	at com.jcabi.aspects.aj.MethodLogger.ajc$inlineAccessMethod$com_jcabi_aspects_aj_MethodLogger$com_jcabi_aspects_aj_MethodLogger$wrap(MethodLogger.java:1)
	at com.jcabi.aspects.aj.MethodLogger.wrapClass(MethodLogger.java:136)
	at com.jcabi.aether.Aether.resolve(Aether.java:156)
	at kscript.app.DependencyUtilKt.resolveDependenciesViaAether(DependencyUtil.kt:86)
	at kscript.app.DependencyUtilKt.resolveDependencies(DependencyUtil.kt:53)
	at kscript.app.KscriptKt.main(Kscript.kt:158)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at org.jetbrains.kotlin.runner.AbstractRunner.run(runners.kt:61)
	at org.jetbrains.kotlin.runner.Main.run(Main.kt:110)
	at org.jetbrains.kotlin.runner.Main.main(Main.kt:120)
Caused by: java.lang.ClassNotFoundException: org.ietf.jgss.GSSException
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 38 more

Is jcabi-aether compatible with java11? If not, is there any workaround to prevent this exception from happening?

It could well be that it is, but the issue is rather caused by the kotlin class-loader (which had some oddities in the past), but it would be nice to narrow the source of the problem.

@0crat
Copy link

0crat commented Jan 29, 2020

@yegor256/z please, pay attention to this issue

@0crat
Copy link

0crat commented Jan 29, 2020

@holgerbrandl/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot!

@yegor256
Copy link
Member

yegor256 commented Aug 5, 2020

@holgerbrandl I have no idea why this is happening? Do you have a hint or we need to investigate?

@holgerbrandl
Copy link
Author

My only suspicion is the module system. It seems that to add the GSSException we may need something like --add-modules java.security.jgss. I'd also love to simply add it as an external jar, but could find any on maven-central or jcenter.

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

No branches or pull requests

3 participants