fix 修复 临时修复dubbo对jdk25的适配问题(jdk25对spi加载有改动导致报错)

This commit is contained in:
疯狂的狮子Li
2026-05-28 16:10:58 +08:00
parent e31947f690
commit 51a351438d
@@ -17,6 +17,13 @@ import org.springframework.context.annotation.PropertySource;
@PropertySource(value = "classpath:common-dubbo.yml", factory = YmlPropertySourceFactory.class)
public class DubboConfiguration {
static {
// JDK 25 下 Dubbo JsonUtils 可能在 ServiceLoader 扫描 JSON SPI 时提前探测到未引入的 Gson 实现。
// 项目按 Dubbo 默认使用 fastjson2,这里只固定首选 JSON 实现,避免误加载 Gson。
System.setProperty("dubbo.json-framework.prefer",
System.getProperty("dubbo.json-framework.prefer", "fastjson2"));
}
/**
* dubbo自定义IP注入(避免IP不正确问题)
*/