Is there workaround for issue with quartz (with persisted job schedules) and axon 3.2, that is not to wait for axon 3.3?

Hi, we upgraded recently to axon 3.2.1, and noticed that now our quartz schedulers within saga are raising errors, like this one:

2018-06-11 11:49:28 ERROR ErrorLogger:2401 - An error occured instantiating job to be executed. job= ‘AxonFramework-Events.event-6df07676-bd92-4470-93d4-9718a1b65242’
org.quartz.SchedulerException: Job instantiation failed [See nested exception: java.lang.IllegalArgumentException: ‘name’ must not be null]
at org.springframework.scheduling.quartz.AdaptableJobFactory.newJob(AdaptableJobFactory.java:47)
at org.quartz.core.JobRunShell.initialize(JobRunShell.java:127)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:392)
Caused by: java.lang.IllegalArgumentException: ‘name’ must not be null
at org.springframework.util.Assert.notNull(Assert.java:193)
at org.springframework.beans.factory.BeanFactoryUtils.transformedBeanName(BeanFactoryUtils.java:74)
at org.springframework.beans.factory.support.AbstractBeanFactory.transformedBeanName(AbstractBeanFactory.java:1117)
at org.springframework.beans.factory.support.AbstractBeanFactory.containsBean(AbstractBeanFactory.java:392)
at org.axonframework.spring.config.AbstractAnnotationHandlerBeanPostProcessor.postProcessAfterInitialization(AbstractAnnotationHandlerBeanPostProcessor.java:66)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:438)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1714)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:414)
at org.springframework.boot.autoconfigure.quartz.AutowireCapableBeanJobFactory.createJobInstance(AutowireCapableBeanJobFactory.java:45)
at org.springframework.scheduling.quartz.AdaptableJobFactory.newJob(AdaptableJobFactory.java:43)
… 2 more

(not so)fun is that we have tests for this sagas with expecting events triggered by quarts, and tests were still green so we were not aware of issues when we tested upgrade :frowning:

And we did recent upgrade from axon 3.1.2 to be able to use nicer query gateway interface for queries that return multiple results -> meaning that we can’t just go back to 3.1.2 since a lot of code would not compile.

After research, we found that this issue is already solved and scheduled for axon 3.3 release:
https://github.com/AxonFramework/AxonFramework/issues/585

Do you know, is there any workaround/configuration that is possible to allow us to keep going somehow until axon 3.3 is released?
Since this is just research project, there is no urgency in this, it is just question to see what is available, and maybe it also helps someone else as well :wink:

Thanks,
Vladimir

Hi Vladimir,

this is related to a change in Spring, where autowiring of Quartz jobs has been added (either in Spring Context, or Spring Boot, both components are in play, here). Unfortunately, it doesn’t have a bean name, which I have never seen happen in Spring 4.x. Axon 3.3 will have the necessary fixes to be able to deal with unnamed beans.

Fortunately, we’re very close to releasing 3.3.

Cheers,

Allard

Hi, to be fair, we are not even sure that it worked with axon 3.1.2, since we used that for some really long term scheduled jobs (scheduled to fire after 30 days period - some auto-expirations thingies). Now we wanted to add some new event triggering that would happen with much higher frequency (on each 30 minutes), and then this problem got on the spotlight.

Maybe it was not 3.1.2 -> 3.2.1 upgrade thing at all, anyways that closed issue #585 explains it is real problem, and it is fixed and planned for axon 3.3.

For now we would just trigger manually some command that generates the same event, to ‘test’ the functionality, and hopefully we would be able to integrate it properly when 3.3 is released.
If there is cleaner/easier workaround, let us know anyways :wink:

Also detail to mention, we use dependency to org.quartz-scheduler 2.3.0 (artifacts quartz and quartz-jobs).

Bye

Ok, replies criss/crossed, great that 3.3 is going to come soon, thanks for reply :wink:
Vladimir