tony
04/22/2022, 5:08 AMjava.lang.NoClassDefFoundError: io/netty/channel/group/ChannelMatchers
at io.netty.channel.group.DefaultChannelGroup.close(DefaultChannelGroup.java:221)
it's unclear how this could happen because DefaultChannelGroup
is not only present in the same jar but also the same package as the class that can't be found. My current best guess is that it has something to do with the fact that ChannelMatchers
is accessed via a static member? Like so:
@Override
public ChannelGroupFuture close() {
return close(ChannelMatchers.all()); // NoClassDefFoundError
}
and it does appear as if there may be another version of this class on a classpath. I can see for example that my IDE has indexed two separate versions of this io.netty:netty-transport
dependency (4.1.34.Final and 4.1.68.Final).
So maybe the JVM can't find the class because another version of it has already been loaded by a related classloader?
What's the relationship between the worker's (so-called "isolated") classloader and other classloaders? There are like 10 in the chain.tony
04/22/2022, 5:09 AMprocessIsolation()
insteadtony
04/22/2022, 5:10 AMephemient
04/22/2022, 5:52 AM((URLClassLoader)getClass().getClassLoader()).getURLs()
in a simple plugin that I have. the top-level classloader has is no differences between classLoaderIsolation
and processIsolation
, containing what I set in the spec classpath
and my plugin, and the parents of each are identical (up to re-ordering), containing just Gradle and its dependencies.tony
04/22/2022, 6:32 AM