Re: Code Review : issue 11984

From: Sheetal Vartak <>
Date: Thu, 9 Dec 2010 15:18:50 -0800

Hi Ed,
Please see comments inline.

On Dec 8, 2010, at 11:21 AM, Ed Burns wrote:

>>>>>> On Tue, 7 Dec 2010 16:20:01 -0800, Sheetal Vartak <> said:
> SV> Glassfish allows creation of virtual servers. Virtual hosting refers
> SV> to the ability to run several web sites (domains) from a single
> SV> physical server machine with a single IP address. To explain a
> SV> little about how one sets up a virtual host, here are a few steps :
> I spoke to Sheetal about this and I requested she learn more about the
> following things, which I don't understand.
> 1. In the case of virtual servers, do all the virtual servers share the
> same VM? Same Web App ClassLoader?
They share the same VM.
> 2. Is it true that ConfigureListener.contextInitialized() is called once
> per each virtual server instance?
> 3. Are the contextInitialized() methods called in parallel or in serial?
> 4. Do all the virtual servers share the same ServletContext instance?
No. There is a separate ServletContext instance per web app per virtual server. For every ServletContext created, there is an InitFacesContext instance created. But the javax.faces.application.Application instance remains a singleton throughout the life of this VM. This is what I'm not sure is correct. If javax.faces.application.Application is supposed to be one per web app, then there needs to be a distinction regarding how many of these should exist w.r.t the number of virtual servers. If we introduce Application instances per web app per virtual server, just like the ServletContext instance, then we will not hit this issue 11984.


> My intuition says the root cause of the bug is the fact that the answer
> to question 3 is "parallel", and the code is clearly not prepared for
> that use case.
> Ed
> --
> | | office: +1 407 458 0017
> | homepage: |