• Icon: Suggestion Suggestion
    • Resolution: Answered
    • None
    • Server - EAP
    • None
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Setting up Active Directory throws a Could not initialize class org.springframework.ldap.core.support.LdapContextSource

      Seems like spring-ldap-core jar is missing from:
      confluence/WEB-INF/lib/spring-ldap-core-2.3.2.RELEASE.jar

      Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.springframework.ldap.core.support.LdapContextSource
        at com.atlassian.crowd.directory.LdapContextSourceFactory.createContextSource(LdapContextSourceFactory.java:73)
        at com.atlassian.crowd.directory.LdapContextSourceProvider.createContextSource(LdapContextSourceProvider.java:32)
        at com.atlassian.crowd.directory.SpringLDAPConnector.getContextSource(SpringLDAPConnector.java:204)
        at com.atlassian.crowd.directory.SpringLDAPConnector.setAttributes(SpringLDAPConnector.java:184)
        at com.atlassian.crowd.directory.loader.RemoteDirectoryInstanceFactoryUtil.newRemoteDirectory(RemoteDirectoryInstanceFactoryUtil.java:42)
        at com.atlassian.crowd.directory.loader.RemoteDirectoryInstanceFactoryUtil.newRemoteDirectory(RemoteDirectoryInstanceFactoryUtil.java:63)
        at com.atlassian.crowd.directory.loader.LDAPDirectoryInstanceLoaderImpl.getRawDirectory(LDAPDirectoryInstanceLoaderImpl.java:30)
        at com.atlassian.crowd.directory.loader.DelegatingDirectoryInstanceLoaderImpl.getRawDirectory(DelegatingDirectoryInstanceLoaderImpl.java:76)
        at com.atlassian.crowd.directory.loader.DbCachingRemoteDirectoryInstanceLoader.getRawDirectory(DbCachingRemoteDirectoryInstanceLoader.java:101)
        at com.atlassian.crowd.directory.loader.DelegatingDirectoryInstanceLoaderImpl.getRawDirectory(DelegatingDirectoryInstanceLoaderImpl.java:76)
        at com.atlassian.confluence.impl.user.crowd.CacheableDirectoryInstanceLoader.getRawDirectory(CacheableDirectoryInstanceLoader.java:92)
        at com.atlassian.crowd.embedded.core.CrowdDirectoryServiceImpl.testConnection(CrowdDirectoryServiceImpl.java:88)
        at com.atlassian.confluence.user.crowd.ConfluenceCrowdDirectoryService.testConnection(ConfluenceCrowdDirectoryService.java:98)
        at jdk.internal.reflect.GeneratedMethodAccessor2471.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod 

       
      Workaround:

      The jpms-args.txt file should contain the --add-exports parameters, it should be referenced in the setenv.sh:

      # Add various JPMS arguments to allow Confluence to work on Java 17
      CATALINA_OPTS="@$CATALINA_HOME/confluence/WEB-INF/jpms-args.txt ${CATALINA_OPTS}" 

       

          Form Name

            [CONFSERVER-83907] Confluence 8.3 EAP Feedback

            Matis Aas added a comment -

            Isn't this the case for all upgrades to this version? Why isn't this included by Atlassian? Just ran into the same issue after upgrading, thank you very much Ksawery Buczkowski

            Matis Aas added a comment - Isn't this the case for all upgrades to this version? Why isn't this included by Atlassian? Just ran into the same issue after upgrading, thank you very much Ksawery Buczkowski

            Tamas Bela added a comment -

            ahh OK, so this line must exist in the setenv.sh. Thanks a lot mate!

            Tamas Bela added a comment - ahh OK, so this line must exist in the setenv.sh. Thanks a lot mate!

            The jpms-args.txt file should contain the --add-exports parameters, it should be referenced in the setenv.sh:

            # Add various JPMS arguments to allow Confluence to work on Java 17
            CATALINA_OPTS="@$CATALINA_HOME/confluence/WEB-INF/jpms-args.txt ${CATALINA_OPTS}" 

             

             

            Ksawery Buczkowski added a comment - The jpms-args.txt file should contain the --add-exports parameters, it should be referenced in the setenv.sh: # Add various JPMS arguments to allow Confluence to work on Java 17 CATALINA_OPTS= "@$CATALINA_HOME/confluence/WEB-INF/jpms-args.txt ${CATALINA_OPTS}"    

            Tamas Bela added a comment -

            Ksawery, could you give us a short hint what your last comment meant in practice? Where should this com.sun.jndi.ldap stuff be? 

            Tamas Bela added a comment - Ksawery, could you give us a short hint what your last comment meant in practice? Where should this com.sun.jndi.ldap stuff be? 

            Ok, looks like this server was missing:
            --add-exports java.naming/com.sun.jndi.ldap=ALL-UNNAMED
            You can close the ticket

            Ksawery Buczkowski added a comment - Ok, looks like this server was missing: --add-exports java.naming/com.sun.jndi.ldap=ALL-UNNAMED You can close the ticket

            Tried another server instance, it works fine there, so it's probably just one instance, but curious why it failed

            Ksawery Buczkowski added a comment - Tried another server instance, it works fine there, so it's probably just one instance, but curious why it failed

            The file org.springframework.ldap_spring-ldap-core-2.3.3.RELEASE.jar is in the LIB folder, but can't find it in OSGI browser

            Ksawery Buczkowski added a comment - The file org.springframework.ldap_spring-ldap-core-2.3.3.RELEASE.jar is in the LIB folder, but can't find it in OSGI browser

              Unassigned Unassigned
              e3f22b065fad Ksawery Buczkowski
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: