I have two JPMS layers:
- Boot layer with
module Aloaded byClassLoaders$AppClassLoader@4fca772d - Child layer with
module Bthat provides cervices and loaded byLoader@6b58b9e9
The parent classloader of Loader@6b58b9e9 is ClassLoaders$AppClassLoader@4fca772d.
In module A I have the following code:
ServiceLoader<ModuleAInterface> sl = ServiceLoader.load(ModuleAInterface.class);
However, the services of Module B are found only when context class loader is Loader@6b58b9e9 and not found when context class loader is ClassLoaders$AppClassLoader@4fca772d.
The question - is it possible to get services of module B in module A without knowing class loader of module B in such configuration.
