• 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

            Renata Dornelas made changes -
            Remote Link Original: This issue links to "Page (Atlassian Documentation)" [ 787266 ]
            Miranda Rawson made changes -
            Description Original: 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


            {code:java}
            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 {code}
             

             
            New: 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


            {code:java}
            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 {code}
             
            Workaround:

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

            {code:java}
            # Add various JPMS arguments to allow Confluence to work on Java 17
            CATALINA_OPTS="@$CATALINA_HOME/confluence/WEB-INF/jpms-args.txt ${CATALINA_OPTS}" {code}
             
            Iker Alonso made changes -
            Remote Link New: This issue links to "Page (Atlassian Documentation)" [ 787266 ]
            Iker Alonso made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 783994 ]

            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? 
            Jiri Hronik made changes -
            Resolution New: Answered [ 9 ]
            Status Original: Gathering Interest [ 11772 ] New: Closed [ 6 ]

            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

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

                Created:
                Updated:
                Resolved: