code: protected PortletApplicationContext createPortletApplicationContext(PortletContext sc) {
          Class<?> contextClass = determineContextClass(sc);
          if (!PortletApplicationContext.class.isAssignableFrom(contextClass)) {
              throw new ApplicationContextException("Custom context class [" + contextClass.getName() +
                      "] is not of type [" + PortletApplicationContext.class.getName() + "]");
          }
          PortletApplicationContext wac =
                  (PortletApplicationContext) BeanUtils.instantiateClass(contextClass);
          return wac;
      }
docs: Instantiate the root PortletApplicationContext for this loader, either the
  default context class or a custom context class if specified.
  <p>This implementation expects custom contexts to implement the
  {@link org.springframework.web.portlet.context.ConfigurablePortletApplicationContext} interface.
  Can be overridden in subclasses.
  <p>In addition, {@link #customizeContext} gets called prior to refreshing the
  context, allowing subclasses to perform custom modifications to the context.
  
  @param sc current portlet context
  @return the root WebApplicationContext
  @see ConfigurablePortletApplicationContext