我的 FishEye 插件应该可以访问我们的 Active Directory 并为 FishEye 实现更多功能。该插件应该每隔 X 分钟与目录同步一次,因此它基于 SAL 调度程序。当我尝试使用 com.sun.jndi.ldap.LdapCtxFactory 时,我发现它只适用于 REST 插件,但即使我重新定义了类加载器,与 SAL 一起使用也不会加载这些类。无论如何,我使用 Spring LDAP 重新实现了我的功能,当我尝试将我的插件部署到 FishEye 时,我得到了:
2014-12-03 23:12:03,010 ERROR [ThreadPoolAsyncTaskExecutor::Thread 9 ] org.springframework.osgi.extender.internal.activator.ContextLoaderListener DefaultOsgiBundleApplicationContextListener-onOsgiApplicationEvent - Application context refresh failed (NonValidatingOsgiBundleXmlApplicationContext(bundle=com.mycompany.fisheye.ldap-restriction-plugin, config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/osgi]
Offending resource: URL [bundle://84.0:0/META-INF/spring/atlassian-plugins-component-imports.xml]
好的。我用谷歌搜索并发现https://developer.atlassian.com/docs/faq/troubleshooting/dependency-issues-during-plugin-initialisation 有文字说我必须将依赖范围更改为提供以避免冲突。好的,我做到了。但现在我有另一个例外:
Exception in thread "PluginSchedulerTask-com.mycompany.fisheye.LdapRestrictio nComponentImpl:job" java.lang.NoClassDefFoundError: org/springframework/ldap/core/support/LdapContextSource
我试图将 spring-ldap-core-1.3.2.RELEASE.jar 放入 $fisheyeDir/lib 并且没有任何反应 - 引导加载程序没有拾取这个 JAR。
有谁知道在这种情况下可以做什么?我应该使用另一个 LDAP 框架还是可以将这些 ldap 客户端实现推送到类路径?
FishEye 版本 3.6.1(最新),将 jar 放入类路径版本 3.0.5.RELEASE。我的 spring-security-ldap 依赖也是 3.0.5.RELEASE。
提前致谢。