Mantis - Resin
Viewing Issue Advanced Details
5514 tweak always 08-01-13 16:25 11-06-14 12:36
beamerblvd  
ferg  
normal  
closed 4.0.37  
fixed  
none    
none 4.0.42  
0005514: Improvement: Order ServletContainerInitializers according to web-fragment order
For context, see https://java.net/jira/browse/SERVLET_SPEC-79. [^]

The Servlet 3.0 and 3.1 specs require no specific order for ServletContainerInitializers. This is a serious flaw in the spec, because it eliminates the ability to guarantee that certain code runs before any other code (for example, initialization of logging frameworks). In Servlet 2.5 and earlier, you could guarantee a exact ordering of startup code, but you can't do that anymore. To be clear, the spec does not prohibit the container from ordering them in a certain way, it just doesn't specify an order that should be followed.

Tomcat (confirmed), TomEE (confirmed), JBoss (confirmed), WebLogic (apparent), and WebSphere (apparent) order SCIs according to the order of the web-fragments they appear in. That way, either using <order> or <absolute-ordering>, an application can guarantee that a particular SCI will run first. Resin executes SCIs in the order they are returned by the ClassLoader.

I believe it would be an improvement for Resin and for the community as a whole if Resin would order SCIs according to the web-fragment order, just like the five aforementioned containers. I intend to lobby hard for this to be the required behavior in the Servlet 3.2 spec. If Resin 4 and 5 implemented this behavior, it would make the argument more compelling, and also require no changes in Resin-next once Servlet 3.2 is finalized.

(FYI: I am filing similar enhancement requests for GlassFish and Jetty.)

Notes
(0006555)
ferg   
11-06-14 12:36   
server/1p0a