I'm trying to schedule tasks in my Java EE application without the use of any database, including any in-memory-databases like derby. The reason why I'm trying to do this, is that I have to deploy my application on a cluster where no database is available.
To reproduce the problem I'm having, here is a minimal java example:
package testPackage;
import javax.ejb.Schedule;
import javax.ejb.Singleton;
import javax.ejb.Startup;
@Startup
@Singleton
public class Scheduler {
@Schedule(second="*", persistent=false)
public void hello() {
System.out.println("Hello");
}
}
When disabling the jdbc/__TimerPool
locally, I get the same error as when I'm trying to deploy on the cluster:
This results in the exception: javax.naming.NamingException: Lookup failed for 'jdbc/__TimerPool' in SerialContext
. The exception however disappears if I remove the @Schedule annotation, which means that by itself the application does not need the TimerPool.
Is it possible to use non-persistent scheduling without any database in Java EE?