Announcement Announcement Module
Collapse
No announcement yet.
SWF 2.3 & JSF 2.1: UnsupportedOperationException at javax.faces.context.FacesContext Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SWF 2.3 & JSF 2.1: UnsupportedOperationException at javax.faces.context.FacesContext

    Hi

    After updating my webapp from JSF 2.0.4 to 2.1 I've got an error based on a missing operation of the FacesContext.
    Is it possible that it has a dependency to <bean id="facesContextListener" class="org.springframework.faces.webflow.FlowFaces ContextLifecycleListener"/> ?
    Problem occures when richfaces is included into the page.

    Projectsetup:
    Spring 3.0.5
    SWF 2.3
    JSF 2.1
    Richfaces 4.0 Final

    Any ideas why this happen? Or is it a Richfaces-Bug?

    Code:
    java.lang.UnsupportedOperationException
    	at javax.faces.context.FacesContext.isReleased(FacesContext.java:609)
    	at com.sun.faces.context.PartialViewContextImpl.updateFacesContext(PartialViewContextImpl.java:468)
    	at com.sun.faces.context.PartialViewContextImpl.isAjaxRequest(PartialViewContextImpl.java:108)
    	at javax.faces.context.PartialViewContextWrapper.isAjaxRequest(PartialViewContextWrapper.java:117)
    	at org.richfaces.context.ExtendedPartialViewContextImpl.isAjaxRequest(ExtendedPartialViewContextImpl.java:138)
    	at javax.faces.context.PartialViewContextWrapper.isAjaxRequest(PartialViewContextWrapper.java:117)
    	at javax.faces.component.UIViewRoot.getRendersChildren(UIViewRoot.java:1020)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1755)
    	at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401)
    	at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
    	at org.springframework.faces.webflow.FlowViewHandler.renderView(FlowViewHandler.java:99)
    	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
    	at org.springframework.faces.webflow.FlowViewHandler.renderView(FlowViewHandler.java:99)
    	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
    	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    	at org.springframework.faces.webflow.FlowLifecycle.render(FlowLifecycle.java:80)
    	at org.springframework.faces.webflow.JsfView.render(JsfView.java:90)
    ...

  • #2
    Are you using Tomcat? Because if you do, JSF 2.1 does not support it.

    Comment


    • #3
      Ok, haven't known that. Thanks for your hint. Yes I'm using Tomcat. Seams to be the problem for this.

      Comment


      • #4
        Just in case, here's the info straight from the horse's mouth: http://javaserverfaces.java.net/nona....0/issues.html

        Comment


        • #5
          seams to be a another bug (richfaces or spring). Have the same behavior on glassfisch 3.1 which is officially supported for jsf 2.1.

          Comment


          • #6
            Try to use JSF 2.0 that worked for me.

            Comment


            • #7
              I am using SWF 2.3 with JSF 2.1 but I had to download the source and make a change to FlowFacesContext in spring-faces.jar to do it.

              It looks like a new method has been introduced in JSF 2.1 which is called isReleased. This method isn't implemented in FlowFacesContext so when using JSF2.1 the call to this method is completed by the parent of FlowFacesContext which throws the UnsupportedOperationException.

              To get around this I downloaded the source, updated the JSF dependency in the maven pom.xml to be a 2.1 version and then added the isReleased method :-
              Code:
              public boolean isReleased() {
                  return delegate.isReleased();
              }
              Rebuilt spring-faces.jar and the problem went away.

              HTH

              Comment


              • #8
                Sorry forgot to mention... If you follow these instructions and are building with maven then there is a problem with the spring-faces maven pom.xml

                See this thread http://forum.springsource.org/showthread.php?t=107320 for details.

                Comment


                • #9
                  Originally posted by garethwebbley View Post
                  Rebuilt spring-faces.jar and the problem went away.
                  I'm attempting to get JSF 2.1 and SWF 2.3 working together (deploying on GlassFish 3.1.1) and have made a lot of strides, thanks in part to your suggestion about the JSF 2.1 fix above.

                  However, none of my actions seem to be interpreted correctly from the view layer. I can click the commandLink elements to my heart's content, but I always get a new version of the original view. Any ideas what I could be doing wrong? I've done a few SWF apps but none involving JSF until now.

                  Comment

                  Working...
                  X