diff --git a/spring-cloud-starter-baidu-starlight/pom.xml b/spring-cloud-starter-baidu-starlight/pom.xml index f5ccb4a3..fe55054a 100644 --- a/spring-cloud-starter-baidu-starlight/pom.xml +++ b/spring-cloud-starter-baidu-starlight/pom.xml @@ -10,7 +10,7 @@ com.baidu.cloud spring-cloud-starter-baidu-starlight - 2022.2.1-SNAPSHOT + 2022.2.2-SNAPSHOT ${project.groupId}:${project.artifactId} Spring Cloud Starlight @@ -21,7 +21,7 @@ Finchley.SR2 2.0.9 - 2022.2.0 + 2022.2.2-SNAPSHOT diff --git a/starlight/pom.xml b/starlight/pom.xml index f213e96d..72835ab0 100644 --- a/starlight/pom.xml +++ b/starlight/pom.xml @@ -5,7 +5,7 @@ com.baidu.cloud starlight - 2022.2.1-SNAPSHOT + 2022.2.2-SNAPSHOT pom ${project.groupId}:${project.artifactId} diff --git a/starlight/starlight-all/pom.xml b/starlight/starlight-all/pom.xml index d951fcb0..3fcabc94 100644 --- a/starlight/starlight-all/pom.xml +++ b/starlight/starlight-all/pom.xml @@ -5,7 +5,7 @@ com.baidu.cloud starlight - 2022.2.1-SNAPSHOT + 2022.2.2-SNAPSHOT starlight-all diff --git a/starlight/starlight-api/pom.xml b/starlight/starlight-api/pom.xml index 96ba535e..df42c578 100644 --- a/starlight/starlight-api/pom.xml +++ b/starlight/starlight-api/pom.xml @@ -5,7 +5,7 @@ com.baidu.cloud starlight - 2022.2.1-SNAPSHOT + 2022.2.2-SNAPSHOT starlight-api @@ -22,7 +22,7 @@ com.baidu.cloud spring-cloud-baidu-thirdparty-commons - 2022.2.0 + 2023.0.1-SNAPSHOT diff --git a/starlight/starlight-api/src/main/java/com/baidu/cloud/starlight/api/transport/Peer.java b/starlight/starlight-api/src/main/java/com/baidu/cloud/starlight/api/transport/Peer.java index df9d4526..605546cb 100644 --- a/starlight/starlight-api/src/main/java/com/baidu/cloud/starlight/api/transport/Peer.java +++ b/starlight/starlight-api/src/main/java/com/baidu/cloud/starlight/api/transport/Peer.java @@ -18,6 +18,10 @@ import com.baidu.cloud.starlight.api.common.URI; import com.baidu.cloud.starlight.api.rpc.Processor; +import com.baidu.cloud.thirdparty.netty.util.internal.NativeLibraryLoader; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; /** * Network peer Created by liuruisen on 2019/11/27. @@ -65,4 +69,24 @@ public interface Peer extends GracefullyShutdown { */ void updateStatus(PeerStatus status); + /** + * starlight中使用的netty so文件与业务应用中使用的要区分开,防止业务也使用netty报错不兼容 + * issue:https://github.com/baidu/starlight/issues/360 + */ + default void updateNettyResourceMetaHome() { + try { + Class loaderClass = NativeLibraryLoader.class; + Field homeFiled = loaderClass.getDeclaredField("NATIVE_RESOURCE_HOME"); + homeFiled.setAccessible(true); + // 去除final修饰符的影响,将字段设为可修改的 + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(homeFiled, homeFiled.getModifiers() & ~Modifier.FINAL); + // 修改字段的内容 + homeFiled.set(null, "META-INF/native/thirdparty"); + } catch (Throwable e) { + // ignore + } + } + } diff --git a/starlight/starlight-core/pom.xml b/starlight/starlight-core/pom.xml index a34ef947..d8c01ee4 100644 --- a/starlight/starlight-core/pom.xml +++ b/starlight/starlight-core/pom.xml @@ -5,7 +5,7 @@ com.baidu.cloud starlight - 2022.2.1-SNAPSHOT + 2022.2.2-SNAPSHOT starlight-core diff --git a/starlight/starlight-protocol/pom.xml b/starlight/starlight-protocol/pom.xml index 66175997..ec1a7471 100644 --- a/starlight/starlight-protocol/pom.xml +++ b/starlight/starlight-protocol/pom.xml @@ -5,7 +5,7 @@ com.baidu.cloud starlight - 2022.2.1-SNAPSHOT + 2022.2.2-SNAPSHOT starlight-protocol diff --git a/starlight/starlight-protocol/starlight-protocol-brpc/pom.xml b/starlight/starlight-protocol/starlight-protocol-brpc/pom.xml index 336102ca..d906c362 100644 --- a/starlight/starlight-protocol/starlight-protocol-brpc/pom.xml +++ b/starlight/starlight-protocol/starlight-protocol-brpc/pom.xml @@ -5,7 +5,7 @@ com.baidu.cloud starlight-protocol - 2022.2.1-SNAPSHOT + 2022.2.2-SNAPSHOT starlight-protocol-brpc diff --git a/starlight/starlight-protocol/starlight-protocol-http/pom.xml b/starlight/starlight-protocol/starlight-protocol-http/pom.xml index fe3a4493..4f5f59a8 100644 --- a/starlight/starlight-protocol/starlight-protocol-http/pom.xml +++ b/starlight/starlight-protocol/starlight-protocol-http/pom.xml @@ -5,7 +5,7 @@ com.baidu.cloud starlight-protocol - 2022.2.1-SNAPSHOT + 2022.2.2-SNAPSHOT starlight-protocol-http diff --git a/starlight/starlight-protocol/starlight-protocol-stargate/pom.xml b/starlight/starlight-protocol/starlight-protocol-stargate/pom.xml index 15070740..dd9e3f6c 100644 --- a/starlight/starlight-protocol/starlight-protocol-stargate/pom.xml +++ b/starlight/starlight-protocol/starlight-protocol-stargate/pom.xml @@ -5,7 +5,7 @@ com.baidu.cloud starlight-protocol - 2022.2.1-SNAPSHOT + 2022.2.2-SNAPSHOT starlight-protocol-stargate diff --git a/starlight/starlight-serialization/pom.xml b/starlight/starlight-serialization/pom.xml index 3a9c48ec..d3a33946 100644 --- a/starlight/starlight-serialization/pom.xml +++ b/starlight/starlight-serialization/pom.xml @@ -5,7 +5,7 @@ com.baidu.cloud starlight - 2022.2.1-SNAPSHOT + 2022.2.2-SNAPSHOT starlight-serialization diff --git a/starlight/starlight-transport/pom.xml b/starlight/starlight-transport/pom.xml index a735ee71..4a413592 100644 --- a/starlight/starlight-transport/pom.xml +++ b/starlight/starlight-transport/pom.xml @@ -5,7 +5,7 @@ com.baidu.cloud starlight - 2022.2.1-SNAPSHOT + 2022.2.2-SNAPSHOT starlight-transport diff --git a/starlight/starlight-transport/src/main/java/com/baidu/cloud/starlight/transport/netty/NettyClient.java b/starlight/starlight-transport/src/main/java/com/baidu/cloud/starlight/transport/netty/NettyClient.java index f88d8b37..b231a255 100644 --- a/starlight/starlight-transport/src/main/java/com/baidu/cloud/starlight/transport/netty/NettyClient.java +++ b/starlight/starlight-transport/src/main/java/com/baidu/cloud/starlight/transport/netty/NettyClient.java @@ -135,6 +135,7 @@ public NettyClient(URI uri) { this.uri = uri; INSTANCE_SET.add(this.uri.getAddress()); + this.updateNettyResourceMetaHome(); } @Override diff --git a/starlight/starlight-transport/src/main/java/com/baidu/cloud/starlight/transport/netty/NettyServer.java b/starlight/starlight-transport/src/main/java/com/baidu/cloud/starlight/transport/netty/NettyServer.java index 9e87f68a..085bd315 100644 --- a/starlight/starlight-transport/src/main/java/com/baidu/cloud/starlight/transport/netty/NettyServer.java +++ b/starlight/starlight-transport/src/main/java/com/baidu/cloud/starlight/transport/netty/NettyServer.java @@ -89,6 +89,7 @@ public class NettyServer implements ServerPeer { public NettyServer(URI uri) { this.uri = uri; this.rpcChannels = new ConcurrentHashMap<>(); + this.updateNettyResourceMetaHome(); } @Override