users@glassfish.java.net

Re: How to guarantee deployment order for ejb/war modules ?

From: Hong Zhang <hong.hz.zhang_at_oracle.com>
Date: Mon, 06 Jun 2011 12:14:22 -0400

If you want to order modules that are part of an enterprise application,
you can use the "initialize-in-order" element in the application.xml
(new in Java EE 6). With the value of this element set to true, modules
will be initialized/loaded in the order they're listed in this
deployment descriptor.

If you are more concerned of the loading order of the standalone
modules, GlassFish currently does not support configuring loading order.
However, with GlassFish, the initial deployment order of the modules
will be the loading order during server restart. For example, if moduleA
is deployed before moduleB, moduleA will be loaded before moduleB during
server restart. You can take advantage of this to order the initial
deployments accordingly.

- Hong

On 6/5/2011 5:48 AM, cinhtau wrote:
>
> boraldo wrote:
>
>> .. I need to guarantee the order of their deployment when I restart
>> server.
>> How can I do this?
>>
>>
>
> Well, there are several solutions. You can use Apache Maven 2 or 3 with
> custom plugins from Glassfish or Cargo. Another solution is to write your
> own shell/python/perl script that installed your modules in predefined
> order.
>