我正在将Sping Boot 版本从2.1.x
升级到2.4.2
。当我编译并运行代码时,我得到了以下警告:
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
字符串
当我将项目部署到AWS和CentOS机器中的DEV环境时,日志中没有这样的警告消息。
谢谢你,
9条答案
按热度按时间az31mfrm1#
我需要一个版本除了分类器:
字符串
作用域是可选的,但分类器是必需的。
有关最新版本,请参阅:https://mvnrepository.com/artifact/io.netty/netty-resolver-dns-native-macos
示例:M1 macs的最新版本(aarch_64),截至2022-01:
型
8yparm6h2#
*Gradle 语法**如果您喜欢:
字符串
对于基于ARM的MacBook:
型
juzqafwq3#
对于这个pull请求https://github.com/netty/netty/pull/10848,日志级别从“debug”更改为“warn”。
要解决此问题,您可以添加此依赖项:
字符串
6qqygrtg4#
按照here的建议,在模块中添加以下依赖项。
字符串
如果您仅在macOS上本地运行应用时遇到此问题,则可以添加特定maven配置文件的依赖项,例如。“本地”。
型
如果在
dependencyManagement
中导入netty-bom,则可以避免指定version
。svdrlsy45#
我的MacBook Pro M1 Pro
字符串
093gszye6#
如果你有Gradle并且只想在本地包含netty,你可以使用https://github.com/google/osdetector-gradle-plugin
字符串
qc6wkl3g7#
字符串
它对我的M1 Pro很有效
2izufjch8#
如果您使用Intellij和gradle,请尝试File->invalidate caches
字符串
dwthyt8l9#
它主要发生在使用Apple Silicon在macOS上进行本地开发期间,如this issue中所讨论的。
如果你使用的是Maven,那么在
pom.xml
中的project
标签下添加以下内容应该可以解决这个问题:字符串
这可确保配置文件仅针对安装了ARM64的macOS激活。