When I deploy my JEE6 application on JBoss EAP 6.3 and shutdown the server before manually undeploying the application I get unexpected Exceptions (see below).
I'm looking for a way to make shutdown work or a reliable source that states that it does not work and won't be fixed.
Yet the shutdown of the application works fine, if done manually (delete the .ear from deployment directory, wait for undeploy, then shutdown JB). No exceptions occur and everything works as expected.
So, I assume there is a way to configure JBoss in a way that does that automatically on server shutdown, send stop signal to the applications, wait until they are gone or timeout is reached, then shutdown the server.
I shutdown JBoss 7 with this command:
jboss-cli.bat --connect --command=:shutdown --timeout=30000 --controller=127.0.0.1:9999
The exceptions I get (e.G. JBAS0141134) make me think that JBoss is removing Beans and Resources that my application depends on before the shutdown sequence is complete.
I control my shutdown process inside a @PreDestroy
inside an @Singleton
that calls some @Stateless
beans that in turn have the database resources, etc.
The most prominent exception I get:
ERROR - JBAS014134:
EJB-Aufruf an Komponente MyStatelessBean
für Methode public abstract void MyStatelessLocal.performShutdownOperation() fehlgeschlagen:
javax.ejb.EJBAccessException: JBAS014502:
Aufruf an Methode: public abstract void MyStatelessLocal.performShutdownOperation()
von Bean: MyStatelessBean ist nicht gestattet
(Indentation is mine)
Keep in mind that even though it says "call is not permitted", the call works fine if I undeploy the application, without shutting down the server.