Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-2414

ClassCastException with Sun/Spring LDAP classes in a plugin

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 2.3.4
    • 2.2.2
    • None

      Sun and Spring LDAP classes are exported inconsistently to plugins, causing:

      java.lang.ClassCastException: com.sun.jndi.ldap.LdapCtx cannot be cast to org.springframework.ldap.core.DirContextAdapter. 
      

      on a call to findUserWithAttributesByName. This can be worked around by passing:

      -Datlassian.org.osgi.framework.bootdelegation=sun.*, com.sun.*, org.springframework.ldap.core.*
      

      A more stable fix would probably be to tweak the exported inclusions/exclusions in components/crowd-server/src/main/resources/applicationContext-CrowdPlugins.xml.

            [CWD-2414] ClassCastException with Sun/Spring LDAP classes in a plugin

            joe added a comment -

            Crowd now sets the context ClassLoader so JNDI can load Spring's DefaultDirObjectFactory.

            joe added a comment - Crowd now sets the context ClassLoader so JNDI can load Spring's DefaultDirObjectFactory .

            shihab added a comment - - edited

            Seems like anything in OSGi-land is affected by not exporting the classes from the host container.

            JIRA and Confluence should also export the classes as they embed Crowd.

            shihab added a comment - - edited Seems like anything in OSGi-land is affected by not exporting the classes from the host container. JIRA and Confluence should also export the classes as they embed Crowd.

              jwalton joe
              jwalton joe
              Affected customers:
              2 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 12h
                  12h
                  Remaining:
                  Time Spent - 7h Remaining Estimate - 5h
                  5h
                  Logged:
                  Time Spent - 7h Remaining Estimate - 5h
                  7h