我的FishEye插件应该有可能访问我们的Active Directory,并为FishEye实现更多的特性。插件应该每隔X分钟与目录进行同步,因此它是基于SAL Scheduler的。当我尝试使用com.sun.jndi.ldap.LdapCtxFactory时,我发现is只适用于REST插件,但是即使在重新定义类加载器时,与SAL一起使用也不会加载这个类。总之,我用Spring重新实现了我的功能,当我尝试将插件部署到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]好的。我在googled上搜索并发现了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 core-1.3.2.RELEASE.jar放到$fisheyeDir/lib中,结果什么都没有发生--引导加载程序没有捡到这个JAR。
有人知道在这种情况下能做些什么吗?我应该使用另一个LDAP框架,还是可以将这些ldap客户端实现推入类路径?
FishEye版本3.6.1 (最新),spring进入类路径版本3.0.5.RELEASE。我的spring-安全-ldap依赖也是3.0.5.RELEASE。
提前谢谢。
发布于 2015-02-19 12:32:19
Spring内部使用( 3.6.1中的3.0.5,3.7时的3.1.4 ),没有公开插件。
相反,他们从亚特兰蒂斯插件系统(https://bitbucket.org/atlassian/atlassian-plugins)获得了一个春季运行时。FishEye使用插件3.0.x,因此插件可用的Spring版本为2.5.6。
FishEye、插件系统和任何捆绑的插件都不包含spring,因此不能将依赖范围设置为(因为这会导致库不包括在插件jar中,而是期望它可以通过OSGI导入获得)。
因此,我认为您应该尝试的是捆绑与Spring2.5.6兼容的Spring版本。要解决BeanDefinitionParsingException问题,您可能需要排除插件系统提供的一些传递依赖项(使用mvn依赖项:tree查找这些依赖项)。
披露:我是一个开发人员,从事鱼眼/坩埚的工作
https://stackoverflow.com/questions/27280197
复制相似问题