I think the general problem is that we are using a ServletContextListener to initilise the application. This initialisation seems to happen at deployment time of the application, which can happen before the XTS service has completed its startup. As the application initialisation depends on XTS being fully started, this can sometimes fail.
Maybe we could use a different initialisation method, for the application, that occurs after the AS startup is complete, but before it accepts its first request?
Is this AS7 we are talking about? If so, then the XTS subsystem could do the necessary dependency setup in the XTS deployment unit processors. Of course, to do that, there might have to be some kind of indication that a particular deployment is actually relevant for XTS processing.
Yes, AS7/8 is what we are targetting.
We have plans to provide a higher level API, for use by the application, to register recovery hooks. It is likely that we will put some 'magic' in the XTS subsytem to support this. Therefore, what you suggest should work.
In the short term, I guess the only work-around we have is to poll for availability of the Recovery Manager.