Multiple "Scheduled Tasks" issues with CUBA legacy-support and Jmix

Jmix version: 1.1.2
Jmix Studio plugin version: 1.1.4-213
IntelliJ IDEA 2021.3 CE - Build #IC-213.5744.223, built on November 27, 2021
Operating System: macOS 12.0.1 (21A559)
File System: Case-Sensitive Journaled HFS+ (APFS)
Datebase: PostgreSQL 13

Hi Everyone

I was trying to test a Scheduled Task that I originally developed in CUBA and found the following issues with both the legacy CUBA “Scheduled Tasks” support (1 - 5) and the new Quarz implementation (6 and 7).

And after my initial 1 - 5 findings listed below, I found the following statement from Natalia here - Administration menu

We made the decision to stop support for our scheduled tasks engine and use instead.

So maybe points 1 - 5 are no longer relevant but if that’s the case, I would not expect to find this legacy implementation in Jmix, so this situation is not completely clear to me. Do you intend to use the Scheduled Tasks screen with the new Quarz backend in the future or are we expected to create our own UI for our Quarz implementation?

  1. In the Scheduled Tasks screen it is only possible to find beans that have an Interface definition. My CUBA-to-Jmix migration removed my Interfaces and generating a new bean (Component) does not generate an Interface source file, so you have to manually create one if you want to use it as a Scheduled Task with the Bean selection.

  2. When I try and run my Scheduled Task I receive this error…

2022-01-09 19:46:09.897 ERROR 11881 — [nio-8080-exec-1] c.h.c.w.a.s.ScheduledTaskBrowser : Can’t execute ScheduledTask{beanName=nf_MembershipService, methodName=expireAllMemberships, className=null, scriptName=null, singleton=true, period=36000, startDate=2022-01-10 00:00:00.000, cron=null}: not in permitted hosts or not a master.

I do not have this problem with CUBA (I leave the “Permitted Servers” field blank) and tried setting the “Permitted Servers” to localhost and to my computer’s hostname in Jmix but that did not have any affect.

  1. And when I receive the error notification the message in point 2, the text contents are missing:


  1. The Scheduled Tasks “User Name” is not a mandatory field but if I do enter a User, e.g. admin, I cannot remove it later. Notice that the screen components are different in CUBA and Jmix:



  1. And I when I try to “Remove” my Scheduled Task, I receive this NPE after pressing the OK button in the confirmation dialog…

at com.haulmont.cuba.gui.components.actions.RemoveAction.doRemove(
at com.haulmont.cuba.gui.components.actions.RemoveAction.remove(
at com.haulmont.cuba.gui.components.actions.RemoveAction.lambda$confirmAndRemove$0(
at io.jmix.core.common.event.EventHub.publish(
at io.jmix.ui.action.BaseAction.actionPerform(
at io.jmix.ui.sys.DialogsImpl$OptionDialogBuilderImpl.lambda$show$0(
at io.jmix.ui.widget.JmixButton.fireClick(
at com.vaadin.ui.Button$
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
at java.base/java.lang.reflect.Method.invoke(
at com.vaadin.server.ServerRpcManager.applyInvocation(
at com.vaadin.server.ServerRpcManager.applyInvocation(
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(
at com.vaadin.server.VaadinService.handleRequest(
at com.vaadin.server.VaadinServlet.service(
at javax.servlet.http.HttpServlet.service(

  1. In the Jmix Quartz documentation Quartz Job Scheduler Setup :: Jmix Documentation it states that you should add the following line to the file… = qrtz_

However, the already contains the following similar definition…,email_,sec_,sys_,ui_

so I assume that the documentation needs to be updated(?) and that I may set the property as follows…,email_,sec_,sys_,ui_,qrtz_

Which is correct excludePrefixes or exclude-prefixes or both?

  1. After following the steps for the Quartz implementation (for my Postgres config.) I receive the following log message at startup…

2022-01-09 11:15:51.385 INFO 8604 — [ main] s.a.ScheduledAnnotationBeanPostProcessor : More than one TaskScheduler bean exists within the context, and none is named ‘taskScheduler’. Mark one of them as primary or name it ‘taskScheduler’ (possibly as an alias); or implement the SchedulingConfigurer interface and call ScheduledTaskRegistrar#setScheduler explicitly within the configureTasks() callback: [core_ThreadPoolTaskScheduler, ui_ThreadPoolTaskScheduler]

What should I do to correct this?

That’s it (so far). Sorry for so many items but I hope that this information is useful.

Best regards

Hello Chris!

In Jmix we’ve decided to use Quartz API instead of our implementation for scheduled tasks, and currently, work is still in progress. Hoping soon this new add-on will be available for you.
Regarding the issues you reported - I have tried to create a CUBA project and migrate it to Jmix to reproduce them. There is my results.

  1. Bean with an interface from the CUBA project migrated successfully to Jmix without removing the interface, as is. Unable to reproduce.
  2. If I have property “cuba.schedulingActive” set to “true”, I’m able to create a new scheduled task with migrated bean and successfully run it. Unable to reproduce.
  3. Cause I haven’t any problem on the second step it is also not reproduced.
  4. It is unable to clear ‘User’ field after setting it. Issue raised
  5. Removing scheduled task failed with an NPE exception. Issue raised
  6. Since Jmix 1.1 uses kebab-case for properties naming, so “exclude-prefixes” more preferable, although both variants - “exclude-prefixes” and “excludePrefixes” are still working in runtime. We recommend to use kebab-case.
  7. I guess it is just INFO message and does not affect scheduler functionality. Nothing special is required.

Regards, Artem.

Hello Artem!

Thank you for your feedback and efforts and for opening the issues.

I was able to reproduce the problems in points 2 and 3 every time I tried to run the task but I did not have the time to try and reproduce it with an example project. If I find time to do this, then I will upload the project.

And I was not able to immediately implement a Quartz example from their website documentation, so I moved onto other post-migration refactoring. I will probably wait until you have released your new implementation before trying anything else. I have more than enough to do right now.

Best regards