Mac m1芯片 项目升级到jdk11启动报错 MacOSDnsServerAddressStreamProvider

转自 https://blog.csdn.net/qq_34373761/article/details/125378192

 

Mac m1芯片 项目升级到jdk11启动报错,Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS.

项目升级到jdk11后,idea本地启动报错,注册中心为nacos,错误详细信息如下

2022-06-20 18:09:49.069 WARN 8598 --- [ctor-http-nio-2] i.n.r.d.DnsServerAddressStreamProviders : Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS.

java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) ~[na:na]
at io.netty.resolver.dns.DnsServerAddressStreamProviders.<clinit>(DnsServerAddressStreamProviders.java:64) ~[netty-resolver-dns-4.1.58.Final.jar:4.1.58.Final]
at io.netty.resolver.dns.DnsNameResolverBuilder.<init>(DnsNameResolverBuilder.java:58) ~[netty-resolver-dns-4.1.58.Final.jar:4.1.58.Final]
at reactor.netty.transport.NameResolverProvider.newNameResolverGroup(NameResolverProvider.java:405) ~[reactor-netty-core-1.0.3.jar:1.0.3]
at reactor.netty.transport.ClientTransportConfig.getOrCreateDefaultResolver(ClientTransportConfig.java:230) ~[reactor-netty-core-1.0.3.jar:1.0.3]
at reactor.netty.transport.ClientTransportConfig.resolverInternal(ClientTransportConfig.java:216) ~[reactor-netty-core-1.0.3.jar:1.0.3]
at reactor.netty.http.client.HttpClientConfig.resolverInternal(HttpClientConfig.java:420) ~[reactor-netty-http-1.0.3.jar:1.0.3]
at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.lambda$subscribe$0(HttpClientConnect.java:262) ~[reactor-netty-http-1.0.3.jar:1.0.3]
at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect$$Lambda$880/0x0000000058616148.accept(Unknown Source) ~[na:na]
at reactor.core.publisher.MonoCreate.subscribe(MonoCreate.java:57) ~[reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxRetryWhen.subscribe(FluxRetryWhen.java:76) ~[reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.MonoRetryWhen.subscribeOrReturn(MonoRetryWhen.java:46) ~[reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57) ~[reactor-core-3.4.2.jar:3.4.2]
at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.subscribe(HttpClientConnect.java:269) ~[reactor-netty-http-1.0.3.jar:1.0.3]
at reactor.core.publisher.Flux.subscribe(Flux.java:8147) ~[reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:173) ~[reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56) ~[reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:154) ~[reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56) ~[reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.4.2.jar:3.4.2]


解决方式,添加如下jar包,

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<version>4.1.75.Final</version> <!--版本号自己切-->
<classifier>osx-aarch_64</classifier>
</dependency>

网上也有人说加下边这个jar包也可以,我没试过,如果上边添加不能解决问题也可以试试

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</dependency>

posted @ 2022-08-30 11:16  别叫我大叔  阅读(1924)  评论(0编辑  收藏  举报