I've come across a behaviour that seems erroneous to me.
If an application contains a @Stateless that has a @Scheduled method
the schedule is not performed for applications that are deployed
disabled, and then subsequently enabled.
The attached .war has a single @Stateless with a @Scheduled method
that logs a message every 10 seconds.
Test case:
1. Deploy the application in disabled state
bin/asadmin deploy --enabled=false scheduled.war
2. Enable the application
bin/asadmin enable scheduled
+. Expected behaviour:
see 'Running' in server log every 10 seconds
-. Actual behaviour:
nothing in log
In contrast when deploying the application enabled:
1. Deploy the application in enabled state
bin/asadmin deploy --enabled=false scheduled.war
+. Expected behavoiur:
see 'Running' in server log every 10 seconds
+. Actual behavoiur:
'Running' shows in log every 10 seconds.
Deploying in enabled state may be the obvious solution, but an
application might require configuration between deployment and
start-up, and hence it is normal to deploy in disabled state,
configuring and then enabling.