Closed jprusch closed 8 years ago
Can you provide any details of what problems you encountered?
Error messages, features that malfunction, logs... any details help.
Sure, when opening adam generated pages some of the user groups defined in the configuration are empty although they contain users in LDAP/AD.
Error message logged:
2015-11-25 15:44:00,229 ERROR [scheduler_Worker-2] [org.quartz.core.JobRunShell] run Job org.echocat.adam.ldapDirectorySynchronizationJob threw an unhandled Exception:
java.lang.NoClassDefFoundError: org/springframework/ldap/core/DirContextAdapter
at org.echocat.adam.directory.DirectoryHelper$AttributeMapperImpl.getValues(DirectoryHelper.java:97)
at com.atlassian.crowd.directory.ldap.mapper.UserContextMapper.mapFromContext(UserContextMapper.java:74)
at com.atlassian.crowd.directory.ldap.mapper.UserContextMapper.mapFromContext(UserContextMapper.java:26)
at com.atlassian.crowd.directory.ldap.mapper.ContextMapperWithCustomAttributes.mapFromContext(ContextMapperWithCustomAttributes.java:31)
at org.springframework.ldap.core.ContextMapperCallbackHandler.getObjectFromNameClassPair(ContextMapperCallbackHandler.java:69)
at org.springframework.ldap.core.CollectingNameClassPairCallbackHandler.handleNameClassPair(CollectingNameClassPairCallbackHandler.java:50)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:367)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:309)
at com.atlassian.crowd.directory.ldap.SpringLdapTemplateWrapper$4.timedCall(SpringLdapTemplateWrapper.java:198)
at com.atlassian.crowd.directory.ldap.SpringLdapTemplateWrapper$4.timedCall(SpringLdapTemplateWrapper.java:195)
at com.atlassian.crowd.directory.ldap.SpringLdapTemplateWrapper$TimedCallable.call(SpringLdapTemplateWrapper.java:126)
at com.atlassian.crowd.directory.ldap.SpringLdapTemplateWrapper.invokeWithContextClassLoader(SpringLdapTemplateWrapper.java:89)
at com.atlassian.crowd.directory.ldap.SpringLdapTemplateWrapper.search(SpringLdapTemplateWrapper.java:195)
at com.atlassian.crowd.directory.SpringLDAPConnector.pageSearchResults(SpringLDAPConnector.java:405)
at com.atlassian.crowd.directory.SpringLDAPConnector.searchEntitiesWithRequestControls(SpringLDAPConnector.java:476)
at com.atlassian.crowd.directory.SpringLDAPConnector.searchEntities(SpringLDAPConnector.java:459)
at com.atlassian.crowd.directory.SpringLDAPConnector.searchUserObjects(SpringLDAPConnector.java:679)
at com.atlassian.crowd.directory.SpringLDAPConnector.searchUsers(SpringLDAPConnector.java:1076)
at org.echocat.adam.synchronization.LdapDirectorySynchronizer$4.nextIterator(LdapDirectorySynchronizer.java:185)
at org.echocat.adam.synchronization.LdapDirectorySynchronizer$4.nextIterator(LdapDirectorySynchronizer.java:178)
at org.echocat.jomon.runtime.iterators.ChainedIterator.hasNext(ChainedIterator.java:51)
at org.echocat.jomon.runtime.iterators.IteratorUtils$4.computeNext(IteratorUtils.java:141)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
at org.echocat.jomon.runtime.iterators.IteratorUtils$3.hasNext(IteratorUtils.java:109)
at org.echocat.adam.synchronization.LdapDirectorySynchronizer.synchronize(LdapDirectorySynchronizer.java:215)
at org.echocat.adam.synchronization.LdapDirectorySynchronizer.synchronize(LdapDirectorySynchronizer.java:199)
at org.echocat.adam.synchronization.LdapDirectorySynchronizationJob.doExecute(LdapDirectorySynchronizationJob.java:54)
at com.atlassian.quartz.jobs.AbstractJob.lambda$executeInternal$105(AbstractJob.java:133)
at com.atlassian.quartz.jobs.AbstractJob$$Lambda$168/507075840.doInHibernate(Unknown Source)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337)
at com.atlassian.quartz.jobs.AbstractJob.executeInternal(AbstractJob.java:122)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at com.atlassian.confluence.plugin.descriptor.JobModuleDescriptor$DelegatingPluginJob.execute(JobModuleDescriptor.java:152)
at com.atlassian.scheduler.quartz1.Quartz1JobFactory$ClassLoaderProtectingWrappedJob.execute(Quartz1JobFactory.java:65)
at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool.lambda$runInThread$183(ConfluenceQuartzThreadPool.java:19)
at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$$Lambda$166/535419643.run(Unknown Source)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
2015-11-25 15:44:00,229 ERROR [scheduler_Worker-2] [org.quartz.core.ErrorLogger] schedulerError Job (org.echocat.adam.ldapDirectorySynchronizationJob threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NoClassDefFoundError: org/springframework/ldap/core/DirContextAdapter]
at org.quartz.core.JobRunShell.run(JobRunShell.java:234)
at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool.lambda$runInThread$183(ConfluenceQuartzThreadPool.java:19)
at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$$Lambda$166/535419643.run(Unknown Source)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: java.lang.NoClassDefFoundError: org/springframework/ldap/core/DirContextAdapter
at org.echocat.adam.directory.DirectoryHelper$AttributeMapperImpl.getValues(DirectoryHelper.java:97)
at com.atlassian.crowd.directory.ldap.mapper.UserContextMapper.mapFromContext(UserContextMapper.java:74)
at com.atlassian.crowd.directory.ldap.mapper.UserContextMapper.mapFromContext(UserContextMapper.java:26)
at com.atlassian.crowd.directory.ldap.mapper.ContextMapperWithCustomAttributes.mapFromContext(ContextMapperWithCustomAttributes.java:31)
at org.springframework.ldap.core.ContextMapperCallbackHandler.getObjectFromNameClassPair(ContextMapperCallbackHandler.java:69)
at org.springframework.ldap.core.CollectingNameClassPairCallbackHandler.handleNameClassPair(CollectingNameClassPairCallbackHandler.java:50)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:367)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:309)
at com.atlassian.crowd.directory.ldap.SpringLdapTemplateWrapper$4.timedCall(SpringLdapTemplateWrapper.java:198)
at com.atlassian.crowd.directory.ldap.SpringLdapTemplateWrapper$4.timedCall(SpringLdapTemplateWrapper.java:195)
at com.atlassian.crowd.directory.ldap.SpringLdapTemplateWrapper$TimedCallable.call(SpringLdapTemplateWrapper.java:126)
at com.atlassian.crowd.directory.ldap.SpringLdapTemplateWrapper.invokeWithContextClassLoader(SpringLdapTemplateWrapper.java:89)
at com.atlassian.crowd.directory.ldap.SpringLdapTemplateWrapper.search(SpringLdapTemplateWrapper.java:195)
at com.atlassian.crowd.directory.SpringLDAPConnector.pageSearchResults(SpringLDAPConnector.java:405)
at com.atlassian.crowd.directory.SpringLDAPConnector.searchEntitiesWithRequestControls(SpringLDAPConnector.java:476)
at com.atlassian.crowd.directory.SpringLDAPConnector.searchEntities(SpringLDAPConnector.java:459)
at com.atlassian.crowd.directory.SpringLDAPConnector.searchUserObjects(SpringLDAPConnector.java:679)
at com.atlassian.crowd.directory.SpringLDAPConnector.searchUsers(SpringLDAPConnector.java:1076)
at org.echocat.adam.synchronization.LdapDirectorySynchronizer$4.nextIterator(LdapDirectorySynchronizer.java:185)
at org.echocat.adam.synchronization.LdapDirectorySynchronizer$4.nextIterator(LdapDirectorySynchronizer.java:178)
at org.echocat.jomon.runtime.iterators.ChainedIterator.hasNext(ChainedIterator.java:51)
at org.echocat.jomon.runtime.iterators.IteratorUtils$4.computeNext(IteratorUtils.java:141)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
at org.echocat.jomon.runtime.iterators.IteratorUtils$3.hasNext(IteratorUtils.java:109)
at org.echocat.adam.synchronization.LdapDirectorySynchronizer.synchronize(LdapDirectorySynchronizer.java:215)
at org.echocat.adam.synchronization.LdapDirectorySynchronizer.synchronize(LdapDirectorySynchronizer.java:199)
at org.echocat.adam.synchronization.LdapDirectorySynchronizationJob.doExecute(LdapDirectorySynchronizationJob.java:54)
at com.atlassian.quartz.jobs.AbstractJob.lambda$executeInternal$105(AbstractJob.java:133)
at com.atlassian.quartz.jobs.AbstractJob$$Lambda$168/507075840.doInHibernate(Unknown Source)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337)
at com.atlassian.quartz.jobs.AbstractJob.executeInternal(AbstractJob.java:122)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at com.atlassian.confluence.plugin.descriptor.JobModuleDescriptor$DelegatingPluginJob.execute(JobModuleDescriptor.java:152)
at com.atlassian.scheduler.quartz1.Quartz1JobFactory$ClassLoaderProtectingWrappedJob.execute(Quartz1JobFactory.java:65)
at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
... 3 more
Might be a packaging / spring config problem due to changes of the underlying Confluence framework.
Anyway GREAT plugin, our users LOVE it.
Thanks,
Jan-Peter
Hi, I dug into the mentioned bug & found out that class
org.springframework.ldap.core.DirContextAdapter
is not avaiable anymore in Confluence 5.9
Form the developer notes on 5.9:
Plugins can use Spring 4.1.6 Affected are add-ons that use Spring classes where a version range is not explicitly set. Addons which use @Deprecated code from the spring <=4 are affected.
As I'm not a Java developer, I could need a hint, how to fix this...
Cheers,
Jan-Peter
is there any change that this problem will be fixed in the near future?
DirContextAdapter is part of Spring LDAP (http://projects.spring.io/spring-ldap/) and still is. I think, Atlassian removed the whole Spring LDAP from Confluence, maybe they don't need it anymore? Did you ask on Atlassian Answers or on some other way? We tried to resolve the problem by importing Spring LDAP by ourselves via maven dependencies. The bug disappeared, but there were other ones so we are not sure if this is the right way ... :/
Hi guys,
it looks not soo easy to fix that but I'am on it right now.
Did a bit of digging and discovered the following:
In Confluence 5.8.x the following OSGi package is exported by the "System Bundle": org.springframework.ldap.core version: 2.0.2.RELEASE It has a coresponding 'jar' at ./confluence/WEB-INF/lib/spring-ldap-core-2.0.2.RELEASE.jar
In Confluence 5.9.x that same jar is present however the package export in the "System Bundle" does not appear. Therefore the package cannot be referenced by adam via OSGi import.
Unfortunately simply specifying spring-ldap-core as a dependency in the pom.xml causes other errors to arise. But hopefully this will help with the research into this issue.
I found a way how to unlock this. It is ugly... but I don't know how choose OSGi for that. ;-)
I will prepare an update with it.
Clever fix, but like you said a bit ugly.
I am beginning to think this may be an oversight on Atlassian's side where they have an API for Crowd but don't export the package required to use said API. From everything I have read, doing this generally results in OSGi resolution issues.
I'll open a support case / bug with them to see if they have any insight into the matter.
Thanks again for the fix to get us back up and running with adam :smile:
Great, tested on our 5.9 instance. Works like a charm!
Many thanks :-)
@lummerland The org.springframework.ldap.core package is no longer exported by any package in Confluence 5.9.x. Previously in Confluence 5.8.x it was included in the System Bundle and was part of WEB-INF/lib in the confluence installation directory. (The jar is still there in 5.9 just not exposed)
Since there is now no clean way (that we know of) to use OSGi to resolve the package, he uses reflection on a Confluence class that has access to the LDAP package to get a reference to it.
There are issues with the latest release.