users@glassfish.java.net

Re: Glassfish EAR deployment order

From: <glassfish_at_javadesktop.org>
Date: Tue, 11 Nov 2008 10:06:54 PST

Hi.

First, a little clarification of terms. Typically "deployment" refers to the process of a human administrator making an app available to GlassFish, using either the admin console or the asadmin command-line utility. So in that sense you, as the administrator, are in complete control of the order of deployment.

I'm sure that's not what you really meant, though, and are probably more interested in controlling the order in which applications are loaded and started once they have been deployed (for instance, during a server restart). There is currently no way in GlassFish v2 to control that for EARs.

One technique you could consider - not pretty but it might work for you - would be to use custom scripts to stop and restart the server. Stopping would consist of disabling the EAR that depends on the other EAR, then actually stopping the server. Starting would consist of starting up the server, then enabling the app that depends on the other EAR. Leaving the EAR that contains the EJB enabled allows GlassFish to start it automatically upon server restart. Then when you enable the EAR that contains the MDB, the EAR with the EJB should be ready.

The other option you mentioned, of fortifying the MDB so it is less dependent on the EJB being accessible when it starts is another approach and might be preferable if only because administrators might forget once in a while to use the scripts to stop and start the server and do so directly.

- Tim
[Message sent by forum member 'tjquinn' (tjquinn)]

http://forums.java.net/jive/thread.jspa?messageID=316073