You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Steven De Groote (Jira)" <de...@myfaces.apache.org> on 2020/05/05 08:46:00 UTC

[jira] [Created] (MYFACES-4335) Unable to resolve SessionScoped bean in PhaseListener after forward

Steven De Groote created MYFACES-4335:
-----------------------------------------

             Summary: Unable to resolve SessionScoped bean in PhaseListener after forward
                 Key: MYFACES-4335
                 URL: https://issues.apache.org/jira/browse/MYFACES-4335
             Project: MyFaces Core
          Issue Type: Bug
            Reporter: Steven De Groote


In a regular Phaselistener, as of JSF 2.2, it is usually possible to [@Inject|https://github.com/Inject] a bean. In my case, I'm injecting a SessionScoped bean, which works well in normal conditions.

However, if an exception occurs, and the PhaseListener is called again for the error page, then the injection point fails. This should not happen.

{{org.jboss.weld.contexts.ContextNotActiveException: WELD-001303:
 No active contexts for scope type 
javax.enterprise.context.SessionScoped at 
org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:647)
 at 
org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:89)
 at 
org.jboss.weld.bean.ContextualInstanceStrategy$CachingContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:164)
 at 
org.jboss.weld.bean.ContextualInstance.getIfExists(ContextualInstance.java:63)
 at 
org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:87)
 at 
org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:131)
 at 
org.primefaces.test.WebSession$Proxy$_$$_WeldClientProxy.getName(Unknown
 Source) at 
org.primefaces.test.LoginController.afterPhase(LoginController.java:26) 
at 
org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:117)
 at 
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:210)
 at 
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:142)
 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:204) at 
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
 at 
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:729)
 at 
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:426)
 at 
com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:182)
 at 
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93)
 at 
com.ibm.ws.security.jaspi.JaspiServletFilter.doFilter(JaspiServletFilter.java:56) }}

{{}}

Note this is the same issue as I posted on OpenLiberty (but without response).
Over there, I uploaded a reprocase: https://github.com/OpenLiberty/open-liberty/issues/9929{{}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)