<div dir="ltr"><div>Perfect. Thank you so much Alan.</div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px;padding:0px;font-size:14px"><span style="font-weight:bold"><br></span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px;padding:0px;font-size:14px"><span style="font-weight:bold">James R.</span><span style="font-weight:bold"> </span><span style="font-weight:bold">Perkins</span><br></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px"><span style="text-transform:uppercase;color:rgb(170,170,170);margin:0px"></span></p><p style="margin:0px"><font color="#000000" face="RedHatText, sans-serif"><span style="font-size:12px">Principal</span></font><span style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px"> Software Engineer</span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px 0px 8px;font-size:12px"><a href="https://www.redhat.com/" style="color:rgb(0,136,206);margin:0px" target="_blank">Red Hat<span></span></a></p><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;margin-bottom:8px"></div><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;height:50px;display:flex;margin-top:8px"><a href="https://www.redhat.com/" target="_blank"><img src="https://static.redhat.com/libs/redhat/brand-assets/2/corp/logo--500.png" height="25px" width="auto"></a></div></div></div></div><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Feb 20, 2025 at 10:44 PM Alan Bateman <<a href="mailto:alan.bateman@oracle.com">alan.bateman@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 21/02/2025 01:08, James Perkins wrote:<br>
> Please forgive me if this is the wrong medium to report this.<br>
><br>
> I've found an issue with the change in the ServiceLoader. <br>
> Specifically, the getConstructor()[1] method. Previously, the method <br>
> caught Throwable and then fail which would throw a <br>
> java.util.ServiceConfigurationError exception. With the changes, only <br>
> a catches a NoSuchMethodException and throws a <br>
> ServiceConfigurationError then. Is this change in behavior expected?<br>
><br>
> For some background on how I found this. I had a legitimate classpath <br>
> issue missing a CDI dependency. However, the constructor was throwing <br>
> a NoClassDefFoundException because of the missing required class. In <br>
> versions less than Java 24 this was okay because Throwable was caught. <br>
> In Java 24 and 25 early access, this is an issue because the <br>
> NoClassDefFoundException is thrown instead of it being wrapped in a <br>
> ServiceConfigurationError.<br>
><br>
Thanks for the bug report. Yes, this is a change in behavior that was <br>
not intended, and a reminder that there aren't enough tests for NCDFE <br>
and other linkage errors. Note that there are other cases, that date <br>
back to JDK 6, where linkage errors aren't wrapped so is other work to <br>
do in this area. I've created JDK-8350481 to track the behavior change.<br>
<br>
-Alan<br>
<br>
[1] <a href="https://bugs.openjdk.org/browse/JDK-8350481" rel="noreferrer" target="_blank">https://bugs.openjdk.org/browse/JDK-8350481</a><br>
<br>
</blockquote></div>