users@glassfish.java.net

Re: Glassfish 2 EAR component deploy order

From: Alexis Moussine-Pouchkine <alexis.moussine-pouchkine_at_oracle.com>
Date: Thu, 15 Dec 2011 09:53:55 +0100

http://blogs.oracle.com/alexismp/entry/module_initialization_order_in_java
If order of separate artifacts matters, then deploying in disabled mode and enabling them in the appropriate order (using asadmin or RESTful interface) is one solution.
-Alexis

On 15 déc. 2011, at 03:43, hong.hz.zhang_at_oracle.com wrote:

> No, there was not a standard way to do it in EE 5. I believe the behavior in GF v2.1 is to load the modules based on the declaration order of the modules in the application.xml. You can give it a try.
>
> In EE 6, the spec has standardized the loading order of the modules with the "initialize-in-order" element in application.xml.
>
> <xsd:element name="initialize-in-order"
> type="javaee:generic-booleanType"
> minOccurs="0"
> maxOccurs="1">
> <xsd:annotation>
> <xsd:documentation>
>
> If initialize-in-order is true, modules must be initialized
> in the order they're listed in this deployment descriptor,
> with the exception of application client modules, which can
> be initialized in any order.
> If initialize-in-order is not set or set to false, the order
> of initialization is unspecified and may be product-dependent.
>
> </xsd:documentation>
> </xsd:annotation>
>
> - Hong
>
> On 12/14/2011 7:30 PM, forums_at_java.net wrote:
>> We have an EAR for Glassfish v2. We currently rely on a Web Context
>> Listener to do some code at application deploy/startup.
>>
>> The problem is that there are several WARs in the EAR, and one of the WARs is
>> firing up before the other WAR gets a chance to do it initial work.
>>
>> So, I am wondering how the deploy order is managed in an EAR.
>>
>> Is it alpabetical based on the WAR name? Location of the WAR in the EAR
>> artifact? Based on the application.xml/sun-application.xml? Is it
>> deterministic at all?
>>
>> I know there is no portable mechanism for this in JEE5, I'm not particularly
>> interested in portable. I'm interested specifically in GFv2.1.1 behavior. Is
>> GFv3 behavior any different? Is there anything I can do to force the
>> deployment order?
>>
>>
>>
>>
>> --
>>
>> [Message sent by forum member 'whartung']
>>
>> View Post: http://forums.java.net/node/874267
>>
>>