war/WEB-INF/lib in JPMS concept

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

war/WEB-INF/lib in JPMS concept

Alex Sviridov
If we place .war file on JPMS layer and this .war file has .jars in WEB-INF/lib what we should
do with these jars? Should we deploy them at the the same JPMS layer with .war module?
I mean :
JPMS layer:
- war module
- jarmodule1_from_war
- jarmodule2_from_war
...
- jarmoduleN_from_war?

Or should we create for them another layer? Or something else?

Best regards, Alex
Reply | Threaded
Open this post in threaded view
|

Re: war/WEB-INF/lib in JPMS concept

Alan Bateman
On 28/09/2018 17:06, Alex Sviridov wrote:

> If we place .war file on JPMS layer and this .war file has .jars in WEB-INF/lib what we should
> do with these jars? Should we deploy them at the the same JPMS layer with .war module?
> I mean :
> JPMS layer:
> - war module
> - jarmodule1_from_war
> - jarmodule2_from_war
> ...
> - jarmoduleN_from_war?
>
> Or should we create for them another layer? Or something else?
This may need someone familiar with servlet or other Java EE specs to
comment. I think, but not certain, that there is something in the
servlet spec about the classes in these JAR files needing to be visible
to the web application class loader. I think it may have something to
imply that the classes in the web application and the classes loaded
from lib/* are defined to the same class loader. In any case, if there
are no overlapping packages then you should be able to map all of the
modules to the same class loader (defineModuelsWithOneLoader) and it
should work.

-Alan.
Reply | Threaded
Open this post in threaded view
|

Re[2]: war/WEB-INF/lib in JPMS concept

Alex Sviridov
Do I understand you right - you suggest to take these jars from /lib and deploy
them on the same layer (where is .war module) as independent modules.
And when we create this layer we create one class loader for all modules?

Best regards, Alex


>Пятница, 28 сентября 2018, 19:45 +03:00 от Alan Bateman <[hidden email]>:
>
>On 28/09/2018 17:06, Alex Sviridov wrote:
>> If we place .war file on JPMS layer and this .war file has .jars in WEB-INF/lib what we should
>> do with these jars? Should we deploy them at the the same JPMS layer with .war module?
>> I mean :
>> JPMS layer:
>> - war module
>> - jarmodule1_from_war
>> - jarmodule2_from_war
>> ...
>> - jarmoduleN_from_war?
>>
>> Or should we create for them another layer? Or something else?
>This may need someone familiar with servlet or other Java EE specs to
>comment. I think, but not certain, that there is something in the
>servlet spec about the classes in these JAR files needing to be visible
>to the web application class loader. I think it may have something to
>imply that the classes in the web application and the classes loaded
>from lib/* are defined to the same class loader. In any case, if there
>are no overlapping packages then you should be able to map all of the
>modules to the same class loader (defineModuelsWithOneLoader) and it
>should work.
>
>-Alan.


--
Alex Sviridov
Reply | Threaded
Open this post in threaded view
|

Re: war/WEB-INF/lib in JPMS concept

Alan Bateman
On 28/09/2018 17:59, Alex Sviridov wrote:
> Do I understand you right - you suggest to take these jars from /lib
> and deploy
> them on the same layer (where is .war module) as independent modules.
> And when we create this layer we create one class loader for all modules?
If there were sharing of the modules in WEB-INF/lib between different
web applications then you could resolve those and put them in their own
configuration and module layer. If there is no sharing then one
configuration and module layer sounds right.

-Alan