Buggy code:
public abstract class FrameworkPortlet extends GenericPortletBean implements ApplicationListener < ContextRefreshedEvent > { public static final Class DEFAULT_CONTEXT_CLASS = XmlPortletApplicationContext . class ; public static final String DEFAULT_NAMESPACE_SUFFIX = "-portlet" ; public static final String PORTLET_CONTEXT_PREFIX = ( FrameworkPortlet . class . getName ( ) ) + ".CONTEXT." ; public static final String [ ] DEFAULT_USERINFO_ATTRIBUTE_NAMES = new String [ ] { "user.login.id" , "user.name" } ; private Class contextClass = FrameworkPortlet . DEFAULT_CONTEXT_CLASS ; private String namespace ; private String contextConfigLocation ; private boolean publishContext = true ; private boolean publishEvents = true ; private boolean threadContextInheritable = false ; private String [ ] userinfoUsernameAttributes = FrameworkPortlet . DEFAULT_USERINFO_ATTRIBUTE_NAMES ; private ApplicationContext portletApplicationContext ; private boolean refreshEventReceived = false ; public void setContextClass ( Class contextClass ) { } public Class getContextClass ( ) { } public void setNamespace ( String namespace ) { } public String getNamespace ( ) { } public void setContextConfigLocation ( String contextConfigLocation ) { } public String getContextConfigLocation ( ) { } public void setPublishContext ( boolean publishContext ) { } public void setPublishEvents ( boolean publishEvents ) { } public void setThreadContextInheritable ( boolean threadContextInheritable ) { } public void setUserinfoUsernameAttributes ( String [ ] userinfoUsernameAttributes ) { } @ Override protected final void initPortletBean ( ) throws PortletException { } protected ApplicationContext initPortletApplicationContext ( ) { } protected ApplicationContext createPortletApplicationContext ( ApplicationContext parent ) { Class < ? > contextClass = getContextClass ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ( ( ( ( ( ( ( "Portlet<seq2seq4repair_space>with<seq2seq4repair_space>name<seq2seq4repair_space>'" + ( getPortletName ( ) ) ) + "'<seq2seq4repair_space>will<seq2seq4repair_space>try<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>custom<seq2seq4repair_space>ApplicationContext<seq2seq4repair_space>context<seq2seq4repair_space>of<seq2seq4repair_space>class<seq2seq4repair_space>'" ) + ( contextClass . getName ( ) ) ) + "'" ) + ",<seq2seq4repair_space>using<seq2seq4repair_space>parent<seq2seq4repair_space>context<seq2seq4repair_space>[" ) + parent ) + "]" ) ) ; } if ( ! ( ConfigurablePortletApplicationContext . class . isAssignableFrom ( contextClass ) ) ) { throw new org . springframework . context . ApplicationContextException ( ( ( ( ( "Fatal<seq2seq4repair_space>initialization<seq2seq4repair_space>error<seq2seq4repair_space>in<seq2seq4repair_space>portlet<seq2seq4repair_space>with<seq2seq4repair_space>name<seq2seq4repair_space>'" + ( getPortletName ( ) ) ) + "':<seq2seq4repair_space>custom<seq2seq4repair_space>ApplicationContext<seq2seq4repair_space>class<seq2seq4repair_space>[" ) + ( contextClass . getName ( ) ) ) + "]<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>ConfigurablePortletApplicationContext" ) ) ; } ConfigurablePortletApplicationContext pac = ( ( ConfigurablePortletApplicationContext ) ( BeanUtils . instantiateClass ( contextClass ) ) ) ; String portletContextName = getPortletContext ( ) . getPortletContextName ( ) ; if ( portletContextName != null ) { pac . setId ( ( ( ( ( ConfigurablePortletApplicationContext . APPLICATION_CONTEXT_ID_PREFIX ) + portletContextName ) + "." ) + ( getPortletName ( ) ) ) ) ; } else { pac . setId ( ( ( ConfigurablePortletApplicationContext . APPLICATION_CONTEXT_ID_PREFIX ) + ( getPortletName ( ) ) ) ) ; } <START_BUG> pac . setEnvironment ( this . getEnvironment ( ) ) ; <END_BUG> pac . setParent ( parent ) ; pac . setPortletContext ( getPortletContext ( ) ) ; pac . setPortletConfig ( getPortletConfig ( ) ) ; pac . setNamespace ( getNamespace ( ) ) ; pac . setConfigLocation ( getContextConfigLocation ( ) ) ; pac . addApplicationListener ( new org . springframework . context . event . SourceFilteringListener ( pac , this ) ) ; postProcessPortletApplicationContext ( pac ) ; pac . refresh ( ) ; return pac ; } protected void postProcessPortletApplicationContext ( ConfigurableApplicationContext pac ) { } public String getPortletContextAttributeName ( ) { } public final ApplicationContext getPortletApplicationContext ( ) { } protected void initFrameworkPortlet ( ) throws PortletException { } public void refresh ( ) { } public void onApplicationEvent ( ContextRefreshedEvent event ) { } protected void onRefresh ( ApplicationContext context ) { } @ Override protected String getTitle ( RenderRequest renderRequest ) { } @ Override public final void processAction ( ActionRequest request , ActionResponse response ) throws IOException , PortletException { } @ Override protected final void doDispatch ( RenderRequest request , RenderResponse response ) throws IOException , PortletException { } @ Override public void serveResource ( ResourceRequest request , ResourceResponse response ) throws IOException , PortletException { } @ Override public void processEvent ( EventRequest request , EventResponse response ) throws IOException , PortletException { } protected final void processRequest ( PortletRequest request , PortletResponse response ) throws IOException , PortletException { } protected LocaleContext buildLocaleContext ( PortletRequest request ) { } protected String getUsernameForRequest ( PortletRequest request ) { } protected abstract void doActionService ( ActionRequest request , ActionResponse response ) throws Exception { } protected abstract void doRenderService ( RenderRequest request , RenderResponse response ) throws Exception { } protected abstract void doResourceService ( ResourceRequest request , ResourceResponse response ) throws Exception { } protected abstract void doEventService ( EventRequest request , EventResponse response ) throws Exception { } @ Override public void destroy ( ) { } }

Fix:
pac . setEnvironment ( getEnvironment ( ) ) ;