Re: Should ClassLoader::getResouces return the same resource twice?

2021-01-04 Thread Johannes Spangenberg
Looks like the ModuleLayer.defineModules is the thing I needed. With it, I can use my current classloader to load all the modules and it can find the classes from both module and unnamed module. Note that class loaders for modules behave differently then original class loaders. For example they

Re: Should ClassLoader::getResouces return the same resource twice?

2021-01-04 Thread Johannes Spangenberg
The bidirectional delegation is an important point. Beside that, you also mentioned that your custom class loader stores additional information. Unfortunately, I cannot only remove the jars from my classloader and delegate to the classloader provided by the ModuleLayer because we use a custom

Re: Should ClassLoader::getResouces return the same resource twice?

2021-01-02 Thread Johannes Spangenberg
Note that you are actually loading the JARs twice which means that you might have two versions of the same classses loaded, not only of the resources. Is this intentional? I still don't know what you want to achieve with your class loader and module layer. Am 02.01.2021 um 21:06 schrieb Thiago

Re: How to do “--add-modules” with dynamically created layer in JPMS?

2020-11-15 Thread Johannes Spangenberg
I think you need to specify the "implementation modules" in the last argument of Configuration.resolveAndBind(...). Best regards, Johannes Am 15.11.2020 um 20:16 schrieb Alex Orlov: Hi all, I create JPMS layer this way: Configuration cf = parentLayer.configuration().resolveAndBind(module