[weld-issues] [JBoss JIRA] (WELD-1037) IllegalStateException when redirecting from system event in JSF managed bean

Kristof Vanbecelaere (Created) (JIRA) jira-events at lists.jboss.org
Sun Jan 1 16:26:09 EST 2012


IllegalStateException when redirecting from system event in JSF managed bean
----------------------------------------------------------------------------

                 Key: WELD-1037
                 URL: https://issues.jboss.org/browse/WELD-1037
             Project: Weld
          Issue Type: Bug
          Components: Web Tier integration (JSF, JSP, EL and Servlet) 
    Affects Versions: 1.1.2.Final
         Environment: JBoss AS7
            Reporter: Kristof Vanbecelaere


I have a view with a system event like so

<f:metadata>
   <f:event type="preRenderView" listener="#{fileUploadBean.checkAccessToken}" />
</f:metadata>

the listener is just a faces managed bean and performs a redirect using FacesContext.getCurrentInstance().getExternalContext().redirect(...);
This leads to an exception. When I disable Weld by removing the empty beans.xml file the redirect works fine.

java.lang.IllegalStateException
	org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:436)
	javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:170)
	org.jboss.weld.servlet.ConversationPropagationFilter$1.sendRedirect(ConversationPropagationFilter.java:90)
	com.sun.faces.context.ExternalContextImpl.redirect(ExternalContextImpl.java:576)
	org.dirtybxl.upload.FileUploadBean.redirectToAuthenticationEntrypoint(FileUploadBean.java:105)
	org.dirtybxl.upload.FileUploadBean.checkAccessToken(FileUploadBean.java:87)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.apache.el.parser.AstValue.invoke(AstValue.java:196)
	org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
	org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43)
	org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56)
	com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
	com.sun.faces.facelets.tag.jsf.core.DeclarativeSystemEventListener.processEvent(EventHandler.java:131)
	javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2508)
	javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
	com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2129)
	com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:2077)
	com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:286)
	com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:244)
	org.jboss.as.weld.webtier.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:293)
	com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
	com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
	com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
	org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
	org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list