How many times one module can exist in layer graph

Alan Bateman Alan.Bateman at oracle.com
Thu Dec 14 13:07:05 UTC 2023


On 14/12/2023 10:56, PavelTurk wrote:
> Hello all.
>
> Let's suppose that we have 4 layers:
> 1) boot
> 2) layerA (parent - boot)
> 3) layerB (parent-boot)
> 4) layerC (parents - layerA, layerB)
>
> Layers A,B,C were created using defineModulesWithOneLoader​(...).
>
> And we have two modules - moduleX and moduleY. ModuleX uses moduleY.
> ModuleX is located in layerC.
>
> Do I understand correctly that moduleY can be located in any layer, but only 
>
> in ONE layer? I mean, that it is impossible to place moduleY in any TWO layers 
>
> at the same time - for example in boot layer and layerB.
>
> I am asking this because I read that it was possible but I tried all 
> variants and
> always got ResolutionException: Module ModuleX reads more than one 
> module named
> ModuleY.

It's possible to have a module "X" n several module layers at the same time.

It's hard to diagnose things from the info in your mail. Can you print 
the Configuration object for layer A, B and C and paste it into a reply? 
There may be implied readability in the picture, or it may be related to 
using a multi-parent Configuration, I can't tell. Also when you say X 
uses Y then I assume you don't mean services, instead you mean X 
requires Y, is that right?

-Alan


More information about the jigsaw-dev mailing list