Application Server 3  4  5 and 6
  1. Application Server 3 4 5 and 6
  2. JBAS-8375

IllegalStateException when using Mojarra 2.0.4-b03

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Major Major
    • Resolution: Won't Fix Won't Fix
    • Affects Version/s: 6.0.0.M4
    • Fix Version/s: None
    • Component/s: JSF
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • Similar Issues:
      Show 10 results 

      Description

      When I replace the JARs for Mojarra 2 in the directory %JBOSS_HOME%\server\default\deployers\jsf.deployer\Mojarra-2.0\jsf-libs with version 2.0.3, then everything works fine.

      However, if I upgrade to Mojarra 2.0.4-b03 then I get the stacktrace below as soon as I invoke my /index.xhtml page which is based on RichFaces 3.3.3. I'm not sure whether the error belongs to JBoss' JSF integration or to RichFaces.

      There is some German text inside the exception message saying: "Illegal attempt to define a ViewHandler after a response was created".

      19:51:20,579 ERROR [org.ajax4jsf.webapp.BaseXMLFilter] Exception in the filter chain:
      javax.servlet.ServletException: Unzulässiger Versuch, ViewHandler festzulegen, nachdem eine Antwort erstellt wurde.
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:321) [:2.0.4-SNAPSHOT]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.20100721-M4]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100721-M4]
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) [:3.3.3.Final]
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) [:3.3.3.Final]
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) [:3.3.3.Final]
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) [:3.3.3.Final]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.20100721-M4]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100721-M4]
      at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:63) [:6.0.0.20100721-M4]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.20100721-M4]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100721-M4]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.20100721-M4]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.20100721-M4]
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.20100721-M4]
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [:6.0.0.20100721-M4]
      at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.CR3]
      at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.CR3]
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.20100721-M4]
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:93) [:6.0.0.20100721-M4]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.20100721-M4]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.20100721-M4]
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.20100721-M4]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.20100721-M4]
      at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.20100721-M4]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.20100721-M4]
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:893) [:6.0.0.20100721-M4]
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:599) [:6.0.0.20100721-M4]
      at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2024) [:6.0.0.20100721-M4]
      at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]
      Caused by: java.lang.IllegalStateException: Unzulässiger Versuch, ViewHandler festzulegen, nachdem eine Antwort erstellt wurde.
      at com.sun.faces.application.ApplicationImpl.setViewHandler(ApplicationImpl.java:559) [:2.0.4-SNAPSHOT]
      at org.ajax4jsf.event.InitPhaseListener.beforePhase(InitPhaseListener.java:92) [:3.3.3.Final]
      at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:224) [:2.0.4-SNAPSHOT]
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:95) [:2.0.4-SNAPSHOT]
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107) [:2.0.4-SNAPSHOT]
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114) [:2.0.4-SNAPSHOT]
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308) [:2.0.4-SNAPSHOT]
      ... 29 more

        Issue Links

          Activity

          Hide
          Juergen Zimmermann
          added a comment -

          The Mojarra issue is at https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1804 . Please feel free to add your comments there.

          Show
          Juergen Zimmermann
          added a comment - The Mojarra issue is at https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1804 . Please feel free to add your comments there.
          Hide
          Alexander Smirnov
          added a comment -

          The easy workaround for this issue is explicit ViewHandler definition in the application faces-config.xml ( config file in the WEB-INF folder always processed last, so ViewHandler defined there will be on top of chain ):
          ............
          <application>
          <view-handler>org.ajax4jsf.application.AjaxViewHandler</view-handler>
          </application>
          ..............
          In this case, listener will detect proper ViewHandler instance on top of chain and does not try to replace it.

          Show
          Alexander Smirnov
          added a comment - The easy workaround for this issue is explicit ViewHandler definition in the application faces-config.xml ( config file in the WEB-INF folder always processed last, so ViewHandler defined there will be on top of chain ): ............ <application> <view-handler>org.ajax4jsf.application.AjaxViewHandler</view-handler> </application> .............. In this case, listener will detect proper ViewHandler instance on top of chain and does not try to replace it.
          Hide
          Juergen Zimmermann
          added a comment -

          When I add <view-handler> to faces-config.xml, then everything works fine with Mojarra 2.0.4-b03 and also with Mojarra 2.1.0-b04.

          I strongly recommend to add this hint to a wiki page.

          Show
          Juergen Zimmermann
          added a comment - When I add <view-handler> to faces-config.xml, then everything works fine with Mojarra 2.0.4-b03 and also with Mojarra 2.1.0-b04. I strongly recommend to add this hint to a wiki page.
          Hide
          Stan Silvert
          added a comment -

          In the Mojarra bug report, Ed says, "I'm going to ask a friend at Exadel to take a look at this. I'm not convinced
          there is an error here. In fact, it is not legal to define a ViewHandler after
          a response was created."

          Is RichFaces defining that ViewHandler after the response is created? If so, I guess this is a RichFaces bug and not a Mojarra bug?

          Show
          Stan Silvert
          added a comment - In the Mojarra bug report, Ed says, "I'm going to ask a friend at Exadel to take a look at this. I'm not convinced there is an error here. In fact, it is not legal to define a ViewHandler after a response was created." Is RichFaces defining that ViewHandler after the response is created? If so, I guess this is a RichFaces bug and not a Mojarra bug?
          Hide
          Jay Balunas
          added a comment -

          In RichFaces 3.3.3.F this is our issue and not JSF RI. Given that this is an older release, with a workaround we will not be resolving it in 3.3.X.

          We will however make sure that the RF wiki pages for AS integration have this info.

          Show
          Jay Balunas
          added a comment - In RichFaces 3.3.3.F this is our issue and not JSF RI. Given that this is an older release, with a workaround we will not be resolving it in 3.3.X. We will however make sure that the RF wiki pages for AS integration have this info.

            People

            • Assignee:
              Jay Balunas
              Reporter:
              Juergen Zimmermann
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: