Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68947

Active Directory plugin fails on Java 17 with IllegalAccessError: "module java.naming does not export com.sun.jndi.ldap to unnamed module"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Official image jenkins/jenkins:2.346.1-lts-jdk17
    • 2.27

      Simply when clicking test connection I'm getting:

      2022-07-06 18:34:33.461+0000 [id=20]    WARNING h.i.i.InstallUncaughtExceptionHandler#handleException: Caught unhandled exception with ID 6d50331d-f504-45a0-80ee-78b906a34772
      java.lang.IllegalAccessError: class hudson.plugins.active_directory.ActiveDirectorySecurityRealm$DescriptorImpl (in unnamed module @0x781dfb3b) cannot access class com.sun.jndi.ldap.LdapCtxFactory (in module java.naming) because module java.naming does not export com.sun.jndi.ldap to unnamed module @0x781dfb3b
              at hudson.plugins.active_directory.ActiveDirectorySecurityRealm$DescriptorImpl.bind(ActiveDirectorySecurityRealm.java:670)
              at hudson.plugins.active_directory.ActiveDirectorySecurityRealm$DescriptorImpl.bind(ActiveDirectorySecurityRealm.java:601)
              at hudson.plugins.active_directory.ActiveDirectorySecurityRealm$DescriptorImpl.bind(ActiveDirectorySecurityRealm.java:566)
              at hudson.plugins.active_directory.ActiveDirectoryDomain$DescriptorImpl.doValidateTest(ActiveDirectoryDomain.java:337)
              at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
      ...
      

      Workaround:
      Add --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED to JAVA_OPTS environment variable.

            basil Basil Crow
            famod Falko Modler
            Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: