My Jakarta web application uses TimerService
to schedule tasks in future.
Everything is working fine (timer are created and timeout methods executed in time) except that timer that should be persistent are not.
The reason is Tomee 9 uses Quartz with a RAMJobStore
by default.
I tried to configure it via the system.properties / application.properties but it does not find the datasource (no problem for Hibernate) :
.apache.openejb.quartz.jobStore.class = .apache.openejb.quartz.impl.jdbcjobstore.JobStoreCMT
.apache.openejb.quartz.jobStore.dataSource = myDataSource
.apache.openejb.quartz.dataSource.myDataSource.jndiURL = java:comp/env/MyDataSource
but it throws :
21-Mar-2025 15:55:37.286 GRAVE [main] .apache.openejb.quartz.utils.JNDIConnectionProvider.init Error looking up datasource: Le Nom [comp/env/MyDataSource] n'est pas lié à ce Contexte
javax.naming.NameNotFoundException: Le Nom [comp/env/MyDataSource] n'est pas lié à ce Contexte
Is it possible to configure Quartz using resources.xml to make it use a JobStoreCMT
instead of a RAMJobStore
?