streamnative / bookkeeper-achieved

Apache Bookkeeper
https://bookkeeper.apache.org
Apache License 2.0
3 stars 2 forks source link

ISSUE-2872: BookieJournalTest on JDK11 is no mapping is defined for the local machine in DNS #422

Open sijie opened 2 years ago

sijie commented 2 years ago

Original Issue: apache/bookkeeper#2872


BUG REPORT

Describe the bug

BookieJournalTest fails with the error below, on ubuntu on JDK11.

To Reproduce Run the test on JDK11 with a virtual machine for which there is no mapping for the "default host"

If I create an entry in /etc/hosts for the local machine, then the test passes

Expected behavior

No error.

Screenshots

java.lang.IllegalAccessError: class javax.naming.spi.NamingManager (in unnamed module @0x5edf2821) cannot access class jdk.internal.loader.ClassLoaderValue (in module java.base) because module java.base does not export jdk.internal.loader to unnamed module @0x5edf2821
        at javax.naming.spi.NamingManager.<clinit>(NamingManager.java:86)
        at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:332)
        at javax.naming.directory.InitialDirContext.getURLOrDefaultInitDirCtx(InitialDirContext.java:106)
        at javax.naming.directory.InitialDirContext.getAttributes(InitialDirContext.java:142)
        at org.apache.bookkeeper.net.DNS.reverseDns(DNS.java:83)
        at org.apache.bookkeeper.net.DNS.getHosts(DNS.java:239)
        at org.apache.bookkeeper.net.DNS.getDefaultHost(DNS.java:338)
        at org.apache.bookkeeper.net.DNS.getDefaultHost(DNS.java:354)
        at org.apache.bookkeeper.bookie.Bookie.getBookieAddress(Bookie.java:583)
        at org.apache.bookkeeper.proto.SimpleBookieServiceInfoProvider.<init>(SimpleBookieServiceInfoProvider.java:39)
        at org.apache.bookkeeper.bookie.Bookie.<init>(Bookie.java:648)
        at org.apache.bookkeeper.bookie.BookieJournalTest.createBookieAndReadJournal(BookieJournalTest.java:658)
        at org.apache.bookkeeper.bookie.BookieJournalTest.testV4Journal(BookieJournalTest.java:399)