if (host == null) {
throw new IllegalArgumentException("Invalid virtual host '" + virtualHost + "'. Do you have a matching Host entry in the server.xml?");
}
// get the webapp context
Context context = (Context) host.findChild(webContext);
context.addLifecycleListener(new LifecycleListener() {
public void lifecycleEvent(LifecycleEvent event) {
Context context = (Context) event.getLifecycle();
if (event.getType().equals(Lifecycle.BEFORE_START_EVENT)) {
context.getServletContext().setAttribute(IGNORE_CONTEXT, "true");