RishiMenpara opened a new pull request, #15751:
URL: https://github.com/apache/dubbo/pull/15751

   ### Rationale for this change
   
   This PR addresses the issue where running Apache Dubbo on **JDK 25** could 
lead to a fatal `NoClassDefFoundError` or other `Throwables` during the 
**ServiceLoader** iteration process within `JsonUtils.java`. This 
incompatibility arises from behavioral changes in the `java.util.ServiceLoader` 
API in recent JDK versions, where `Iterator.hasNext()` can now throw exceptions 
when attempting to load a service provider that has missing dependencies.
   
   ### What is the effect of this change?
   
   Without this fix, users running on JDK 25 (especially those not using a JSON 
framework that Dubbo expects) will experience application startup failure.
   
   ### Detailed Fix
   
   The `loadExtensions()` method in `JsonUtils` has been refactored from a 
`for` loop to a safe `while(true)` loop. This allows both the `it.hasNext()` 
and `it.next()` calls to be wrapped in a single `try-catch (Throwable)` block, 
safely skipping any broken service provider definitions without crashing the 
entire iteration process.
   
   ### Related Issue
   
   Closes #15747


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to