I’m upgrading my Spring Boot version from 2.1.x
to 2.4.2
. When I compiled and run the code, I got the following warning:
Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider,fallback to system defaults. This may result in incorrect DNS resolutions on MacOS.
java.lang.ClassNotFoundException: io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider
When I deploy the project to DEV environment which is in AWS and CentOS machine, there is no such warning message in the logs.
Thanks,
8
Answers
For this pull request https://github.com/netty/netty/pull/10848, the log level changes from "debug" to "warn."
To solve this problem, you can add this dependency:
As suggested here, add the following dependency in your module.
If you face this issue only while running your app locally on macOS, you may add the dependency for a specific maven profile, e.g. "local".
You can avoid specifying
version
if you import netty-bom independencyManagement
.I needed a version in addition to classifier:
scope is optional but classifier is required.
For the latest version, see:
https://mvnrepository.com/artifact/io.netty/netty-resolver-dns-native-macos
Example: Latest version for M1 macs (aarch_64), as of 2022-01:
Gradle syntax if you prefer:
and for ARM-based macbook:
This one is working on my MacBook Pro M1 Pro
If you have Gradle and want to include netty only locally you can make use of https://github.com/google/osdetector-gradle-plugin
If you are using Intellij and gradle try File->invalidate caches
it works for me on my M1 pro