ServletContext ctx = session.getServletContext();
PlexusContainer parent = (PlexusContainer) ctx.getAttribute(KEY);
PlexusContainer child = parent.createChildContainer("session", Collections.EMPTY_LIST, Collections.EMPTY_MAP);
session.setAttribute(KEY, child);
PlexusUtils.configure(child, "plexus-session.xml");
child.initialize();
child.start();
} catch (Exception e) {
LOG.error("Error initializing plexus container (scope: session)", e);
}
}