You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to create a hot fix module that can be deployed individually, without a dependency on Dynamic Extensions. It should also be able to co-exist with DE in order to be usable in our development & hosting environments.
Unfortunately, we ran into an issue, where multiple candidates for a Quartz' SchedulerFactoryBean, when applying both a DE amp that uses scheduling and our ALF-22094 hot fix AMP, causing NoUniqueBeanDefinitionException at startup.
Quartz Schedulers from different modules can coexist if:
They are marked as non-primary
They have unique bean qualifiers
Current Behavior
An exception is thrown, leaving the default Quartz scheduler not registered in the Spring context - thus it will not be used by Dynamic Extension Modules.
[ALFRESCO] 2020-05-13 14:01:23,487 ERROR [internal.activator.ContextLoaderListener] [localhost-startStop-1] Application context refresh failed (DynamicExtensionsApplicationContext(bundle=eu.xenit.de.control-panel, config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'quartzTaskScheduler': Unsatisfied dependency expressed through bean property 'scheduler': : No qualifying bean of type [org.quartz.Scheduler] is defined: expected single matching bean but found 2: schedulerFactory,eu.xenit.alfresco.AntiIdleSchedulerFactoryBean; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.quartz.Scheduler] is defined: expected single matching bean but found 2: schedulerFactory,eu.xenit.alfresco.AntiIdleSchedulerFactoryBean
Possible Solution
Add qualifier annotation to both QuartzTaskScheduler and Quartz2TaskScheduler.
Register their beans as AbstractBeanDefinition.AUTOWIRE_BY_NAME instead of AbstractBeanDefinition.AUTOWIRE_BY_TYPE.
The text was updated successfully, but these errors were encountered:
todorinskiz
changed the title
UnsatisfiedDependencyException caused by NoUniqueBeanDefinitionException
Multiple candidates for a Quartz' SchedulerFactoryBean
May 14, 2020
I'm submitting a
Context
We are trying to create a hot fix module that can be deployed individually, without a dependency on Dynamic Extensions. It should also be able to co-exist with DE in order to be usable in our development & hosting environments.
Unfortunately, we ran into an issue, where multiple candidates for a Quartz'
SchedulerFactoryBean
, when applying both a DE amp that uses scheduling and our ALF-22094 hot fix AMP, causing NoUniqueBeanDefinitionException at startup.https://github.com/xenit-eu/alfresco-hotfix-ALF-22094
Expected Behavior
Quartz Schedulers from different modules can coexist if:
Current Behavior
An exception is thrown, leaving the default Quartz scheduler not registered in the Spring context - thus it will not be used by Dynamic Extension Modules.
Possible Solution
Add qualifier annotation to both
QuartzTaskScheduler
andQuartz2TaskScheduler
.Register their beans as
AbstractBeanDefinition.AUTOWIRE_BY_NAME
instead ofAbstractBeanDefinition.AUTOWIRE_BY_TYPE
.Steps to Reproduce
1.1. Dynamic Extensions 2.0.3 or older
1.2. https://github.com/xenit-eu/alfresco-hotfix-ALF-22094 any version
Stack Trace
de-issue-stacktrace-scheduler-beans.txt
Your Environment
The text was updated successfully, but these errors were encountered: