Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-26038 Support JDK17
  3. HBASE-28341

[JDK17] Fix Failure TestLdapHttpServer

    XMLWordPrintableJSON

Details

    Description

      TestLdapHttpServer is failing with JDK17 because of internal APIs usage.

      [INFO] Running org.apache.hadoop.hbase.http.TestLdapHttpServer
      [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 7.18 s <<< FAILURE! - in org.apache.hadoop.hbase.http.TestLdapHttpServer
      [ERROR] org.apache.hadoop.hbase.http.TestLdapHttpServer  Time elapsed: 7.165 s  <<< ERROR!
      java.lang.IllegalAccessError: class org.apache.directory.server.core.security.CertificateUtil (in unnamed module @0x25bbf683) cannot access class sun.security.x509.X500Name (in module java.base) because module java.base does not export sun.security.x509 to unnamed module @0x25bbf683
      	at org.apache.directory.server.core.security.CertificateUtil.createTempKeyStore(CertificateUtil.java:334)
      	at org.apache.directory.server.factory.ServerAnnotationProcessor.instantiateLdapServer(ServerAnnotationProcessor.java:158)
      	at org.apache.directory.server.factory.ServerAnnotationProcessor.createLdapServer(ServerAnnotationProcessor.java:318)
      	at org.apache.directory.server.factory.ServerAnnotationProcessor.createLdapServer(ServerAnnotationProcessor.java:351)
      	at org.apache.directory.server.core.integ.CreateLdapServerRule$2.evaluate(CreateLdapServerRule.java:112)
      	at org.apache.directory.server.core.integ.CreateDsRule$2.evaluate(CreateDsRule.java:124)
      	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
      	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:316)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:240)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:214)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:155)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
      	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
      	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
      
      [INFO] 
      [INFO] Results:
      [INFO] 
      [ERROR] Errors: 
      [ERROR]   TestLdapHttpServer ยป IllegalAccess class org.apache.directory.server.core.security.CertificateUtil (in unnamed module @0x25bbf683) cannot access class sun.security.x509.X500Name (in module java.base) because module java.base does not export sun.security.x509 to unnamed module @0x25bbf683
      [INFO] 
      [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
      
      

      Adding following to jvn flags works.

      +      --add-opens java.base/sun.security.x509=ALL-UNNAMED
      +      --add-opens java.base/sun.security.util=ALL-UNNAMED
      

      Attachments

        Issue Links

          Activity

            People

              rajeshbabu Rajeshbabu Chintaguntla
              rajeshbabu Rajeshbabu Chintaguntla
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: