3

I am coding with Vertx, when I run Junit test under my laptop (MacOs), all unit tests failed, in fact, when these unit tests are run successfully under Linux.

This is my Java 11 version:

java version "11.0.12" 2021-07-20
IBM Semeru Runtime Certified Edition 11.0.12.0 (build 11.0.12+7)
Eclipse OpenJ9 VM 11.0.12.0 (build openj9-0.27.0, JRE 11 Mac OS X amd64-64-Bit Compressed References 20210901_134 (JIT enabled, AOT enabled)
OpenJ9   - 1851b0074
OMR      - 9db1c870d
JCL      - 54d2067eec based on jdk-11.0.12+7)

I am using gradle 7.2 as well

When I ran ./gradlew clean build, then unit test are executed, then I saw the following error. It seem vertx call netty, then netty library get error that complain MacOS.

Can not find io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider in the classpath, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS.

BTW, this is our Vertx version

    implementation group: 'io.vertx', name: 'vertx-core', version: '4.0.3'

Any ideas for that? how to fix it?

Joe
  • 623
  • 7
  • 16
  • What is your macOS chip architecture? How does the unit tests setup look like? – tmarwen Oct 09 '21 at 15:17
  • As a workaround you can try this answer: https://stackoverflow.com/a/53713256/1868281 – Selim Oct 14 '21 at 08:10
  • Does this answer your question? [Spring Boot 2.4.2 - DNS Resolution Problem at start on Apple M1](https://stackoverflow.com/questions/65954571/spring-boot-2-4-2-dns-resolution-problem-at-start-on-apple-m1) – pixel Mar 04 '22 at 09:02

2 Answers2

4

From this and this reported identical/similar issues, you may want to consider adding these in your gradle configs

  1. runtimeOnly("io.netty:netty-resolver-dns-native-macos:XXX:osx-x86_64")

where XXX is version of netty-resolver-dns-native-macos

or

  1. io.netty:netty-all:4.1.68.Final.
4

Please add below dependency to pom. Still this is not a fix, its just a work around.

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
</dependency>
Arundev
  • 1,388
  • 23
  • 22