The root cause is that setupContext in ManagedFuture (incorrectly) finds that the application is NOT enabled. The issue is
in ContextSetupProviderImpl.isApplicationEnabled(). This method probably needs to look into the application version field
before deciding if the app is disabled or not.
For example, after deploying an app with a different version, as you could see from the below output,
only app1:v3 is enabled. So, maybe ContextSetupProviderImpl.isApplicationEnabled() (or some
other utility method) should look into the versioning field of the app to decide correctly, if it is
enabled or not.
asadmin list-applications --long
NAME TYPE STATUS
app1 <ejb, web> disabled
app1:v1 <ejb, web> disabled
app1:v2 <ejb, web> disabled
app1v3 <ejb, web> enabled
Command list-applications executed successfully.
Here is the call stack when a batch job is submitted from a versioned app.
appName = handle.getInvocation().getAppName();
Unfortunately, isapplicationEnabled(appName) returns false thus causing
contextSetupException to IllegalStateException.
This causes ManagedfutureTask.run() method to be aborted. Hence the Batch job
is never executed.