Encountered "no netty_resolver_dns_native_macos_x86_64 in java.library.path" when attempting use Spring Webflux WebClient

Viewed 1742

as per the title above.

Been getting this error:

00:41:21.549 [main] DEBUG io.netty.util.internal.NativeLibraryLoader - Unable to load the library 'netty_resolver_dns_native_macos_x86_64', trying other loading mechanism.

java.lang.UnsatisfiedLinkError: no netty_resolver_dns_native_macos_x86_64 in java.library.path:

While trying to test out WebClient as a replacement for RestTemplate.

What I've tried:

  1. Excluding Netty from the spring-boot-starter-webflux dependency and adding spring-boot-starter-reactor-netty as an explicit dependency.
  2. Adding netty-resolver-dns-native-macos as a dependency.

Neither seems to work.

Using spring boot parent 2.4.2

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-dependencies</artifactId>
    <version>${spring.boot.version}</version>
    <scope>import</scope>
    <type>pom</type>
  </dependency>
1 Answers
    <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-resolver-dns-native-macos</artifactId>
        <version>4.1.79.Final</version>
        <classifier>osx-aarch_64</classifier>
    </dependency>
Related