Classloading with multiple parent layers JDK11 vs JDK14

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

Classloading with multiple parent layers JDK11 vs JDK14

Alex Sviridov

Hi all,
 
I have the following layers:
 
LayerA (moduleA)                   LayerB (moduleB)
             |_____________________|
                                 |
                   LayerC(moduleC)
 
LayerC has two parent layers layerA and LayerB and moduleC requires moduleA
and moduleB. When I start my application with JDK 11/14 I get no resolving errors
and everything is ok. However, when I use JDK 11 in moduleC when I use
application I get  java.lang.NoClassDefFoundError moduleB.Foo.class,
when I run with JDK 14 I don’t get such exception. The JDK I use listed
below.
 
Could anyone say — the behavior differs because of the different JDKs,
or the problem is that when multiple layers are parent there is possibility
that class won’t be found, or the problem is in my application?
 
JDK 14:
openjdk version "14" 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)
JDK 11:
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
pavel@pc1:~/WorkAndShow/Server/bin$
 
 
--
Alex Sviridov
Reply | Threaded
Open this post in threaded view
|

Re: Classloading with multiple parent layers JDK11 vs JDK14

Alan Bateman
On 17/04/2020 21:11, Alex Sviridov wrote:

> Hi all,
>  
> I have the following layers:
>  
> LayerA (moduleA)                   LayerB (moduleB)
>               |_____________________|
>                                   |
>                     LayerC(moduleC)
>  
> LayerC has two parent layers layerA and LayerB and moduleC requires moduleA
> and moduleB. When I start my application with JDK 11/14 I get no resolving errors
> and everything is ok. However, when I use JDK 11 in moduleC when I use
> application I get  java.lang.NoClassDefFoundError moduleB.Foo.class,
> when I run with JDK 14 I don’t get such exception. The JDK I use listed
> below.
>
Is moduleB an automatic module? If so then you are probably running into
JDK-8211825 [1].

-Alan.

[1] https://bugs.openjdk.java.net/browse/JDK-8211825
Reply | Threaded
Open this post in threaded view
|

Re[2]: Classloading with multiple parent layers JDK11 vs JDK14

Alex Sviridov

Hi Alan,
 
Thank you for your answer. Yes, moduleB is an automatic module and there is
also no problem when I use JDK12. So it seems to be that bug. I will report
if I see problem with JDK12+.
 
Best regards
 

>Суббота, 18 апреля 2020, 10:06 +03:00 от Alan Bateman <[hidden email]>:

>On 17/04/2020 21:11, Alex Sviridov wrote:
>> Hi all,
>>
>> I have the following layers:
>>
>> LayerA (moduleA)                   LayerB (moduleB)
>>              |_____________________|
>>                                  |
>>                    LayerC(moduleC)
>>
>> LayerC has two parent layers layerA and LayerB and moduleC requires moduleA
>> and moduleB. When I start my application with JDK 11/14 I get no resolving errors
>> and everything is ok. However, when I use JDK 11 in moduleC when I use
>> application I get  java.lang.NoClassDefFoundError moduleB.Foo.class,
>> when I run with JDK 14 I don’t get such exception. The JDK I use listed
>> below.
>> Is moduleB an automatic module? If so then you are probably running into
>JDK-8211825 [1].
>
>-Alan.
>
>[1]  https://bugs.openjdk.java.net/browse/JDK-8211825 
 
 
--
Alex Sviridov