What is this?

This is an example cross-product Atlassian plugin for Confluence & JIRA that demonstrates a trivial example of using the Spring LDAP framework to connect to a remote LDAP server from within a "plugins-2" plugin.

Currently it does not work in JIRA due to some missing OSGI exports (see JRA-29896).

NOTE: This is an example plugin for demonstration purposes only. It is not suitable for installation on a production server - use at your own risk!

How do I use it?

Run the plugin using the Atlassian Plugin SDK and then access the test LDAP servlet @ ${BASE_URL}/plugins/servlet/ldaptest.

In the current version of JIRA, accessing this servlet will cause an exception to be thrown when the Servlet plugin module is initialised, generating a stacktrace like this and showing a 404 Page to the user.

[INFO] [talledLocalContainer] 2012-10-11 17:42:25,359 http-2990-3 ERROR anonymous 1062x501x1 - /plugins/servlet/ldaptest [atlassian.plugin.module.PrefixDelegatingModuleFactory] Detected an error (NoClassDefFoundError) instantiating the module for plugin 'com.example.ldap.example-ldap-plugin' for module 'ldap-servlet': org/springframework/ldap/core/ContextSource.  This error is usually caused by your plugin using a imported component class that itself relies on other packages in the product. You can probably fix this by adding the missing class's package to your <Import-Package> instructions; for more details on how to fix this, see .
[INFO] [talledLocalContainer] 2012-10-11 17:42:25,361 http-2990-3 ERROR anonymous 1062x501x1 - /plugins/servlet/ldaptest [atlassian.plugin.servlet.DefaultServletModuleManager] Unable to create servlet
[INFO] [talledLocalContainer] com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NoClassDefFoundError: org/springframework/ldap/core/ContextSource
[INFO] [talledLocalContainer]   at com.atlassian.util.concurrent.LazyReference.getInterruptibly(
[INFO] [talledLocalContainer]   at com.atlassian.util.concurrent.LazyReference.get(
[INFO] [talledLocalContainer]   at com.atlassian.plugin.servlet.DefaultServletModuleManager.getServlet(
[INFO] [talledLocalContainer]   at com.atlassian.plugin.servlet.DefaultServletModuleManager.getServlet(
[INFO] [talledLocalContainer]   at com.atlassian.plugin.servlet.ServletModuleContainerServlet.service(
[INFO] [talledLocalContainer]   at javax.servlet.http.HttpServlet.service(
[INFO] [talledLocalContainer] Caused by: java.lang.NoClassDefFoundError: org/springframework/ldap/core/ContextSource
[INFO] [talledLocalContainer]   at java.lang.Class.getDeclaredConstructors0(Native Method)
[INFO] [talledLocalContainer]   at java.lang.Class.privateGetDeclaredConstructors(
[INFO] [talledLocalContainer]   at java.lang.Class.getConstructors(
[INFO] [talledLocalContainer]   at
[INFO] [talledLocalContainer]   at
[INFO] [talledLocalContainer]   at
[INFO] [talledLocalContainer]   at$
[INFO] [talledLocalContainer] Caused by: java.lang.ClassNotFoundException: org.springframework.ldap.core.ContextSource
[INFO] [talledLocalContainer]   at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(
[INFO] [talledLocalContainer]   at org.apache.felix.framework.ModuleImpl.access$200(
[INFO] [talledLocalContainer]   at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(
[INFO] [talledLocalContainer]   at java.lang.ClassLoader.loadClass(

In Confluence (and JIRA if JRA-29896 is fixed) you'll see an HTML form where you can input connection details for an LDAP server. Atlassians can use their EAC-Crowd credentials to connect to Hitting submit will invoke Spring LDAP to connect to the specified LDAP server and list and the Person objects identified within the Base DN.