public void contextualize(Context context) throws ContextException {
this.context = context;
try {
// now get the portal manager
ServletConfig servletConfig = (ServletConfig) context.get(CocoonServlet.CONTEXT_SERVLET_CONFIG);
PortletPortalManager portalManager = (PortletPortalManager) servletConfig.getServletContext().getAttribute(PortalManager.ROLE);
this.portletContainer = portalManager.getPortletContainer();
this.environment = portalManager.getPortletContainerEnvironment();
} catch (ContextException ignore) {
// we ignore the context exception
// this avoids startup errors if the portal is configured for the CLI
// environment
this.getLogger().warn("The JSR-168 support is disabled as the servlet context is not available.", ignore);