Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.0.3-SNAPSHOT
-
None
-
None
-
MyFaces 2.0.3-SNAPSHOT in Dev mode, OpenWebBeans 1.0.0, Tomcat 6.0.29 (with Glassfish EL 2.2)
Description
I have a logout method, shown below:
public String logout() {
final FacesContext fc = FacesContext.getCurrentInstance();
final ExternalContext externalContext = fc.getExternalContext();
try
catch (IOException e)
{ log.error("Error redirecting after logout", e); }finally
{ fc.responseComplete(); } return null;
}
When I invoke this method, I get the following Exception from OpenWebBeans:
javax.enterprise.context.ContextNotActiveException: WebBeans context with scope type annotation @SessionScoped does not exist within current thread
at org.apache.webbeans.container.BeanManagerImpl.getContext(BeanManagerImpl.java:309)
at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:124)
at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:95)
at org.apache.myfaces.examples.ebanking.web.bean.SessionBean_$$javassist_2.getCustomer(SessionBean$$_javassist_2.java)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:302)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:142)
at org.apache.el.parser.AstValue.getValue(AstValue.java:123)
at org.apache.el.parser.AstEmpty.getValue(AstEmpty.java:45)
at org.apache.el.parser.AstNot.getValue(AstNot.java:42)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.webbeans.el.WrappedValueExpression.getValue(WrappedValueExpression.java:68)
at org.apache.myfaces.view.facelets.el.TagValueExpression.getValue(TagValueExpression.java:85)
at javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:260)
at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1007)
at javax.faces.component.UIComponent.isVisitable(UIComponent.java:289)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:752)
at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:991)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:778)
at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:991)
at org.apache.myfaces.view.facelets.tag.ui.DebugPhaseListener._doTreeVisit(DebugPhaseListener.java:310)
at org.apache.myfaces.view.facelets.tag.ui.DebugPhaseListener.afterPhase(DebugPhaseListener.java:286)
at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:111)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:185)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
This happens because the DebugPhaseListener starts visiting the tree and, in the process, needs to resolve a value expression, which points to an OWB session bean.
It only happens when the DebugPhaseListener is installed. In production mode everything is fine.
Attachments
Attachments
Issue Links
- depends upon
-
MYFACES-2676 Include the whole component tree with all real values in the debug page
- Closed
- duplicates
-
MYFACES-3187 DebugPhaseListener shouldn't be active by default
- Closed