Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-13472

Action listener: binding doesn't work

    Details

    • Sprint:
      5.0.0.Alpha3 - Sprint 2

      Description

      1. deploy Metamer and open http://localhost:8080/metamer/faces/components/a4jActionListener/all.xhtml
        or
      2. deploy Showcase and open http://localhost:8080/showcase/richfaces/component-sample.jsf?demo=actionListener&skin=blueSky

      result:

      • in Showcase this stack trace is displayed instead of page (Metamer is similar)

        javax.faces.view.facelets.TagAttributeException: /richfaces/actionListener/samples/actionListener-sample.xhtml @30,88 listener="#{actionListenerBean.handleActionMethod}" null
        	com.sun.faces.facelets.tag.TagAttributeImpl.getMethodExpression(TagAttributeImpl.java:232)
        	org.richfaces.ui.ajax.ActionListenerHandler.applyAttachedObject(ActionListenerHandler.java:100)
        	org.richfaces.ui.ajax.ActionListenerHandler.apply(ActionListenerHandler.java:138)
        	javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        	javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
        	org.richfaces.ui.behavior.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)
        	com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187)
        	javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
        	javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        	javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
        	org.richfaces.ui.behavior.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)
        	com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187)
        	javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
        	javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        	javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
        	org.richfaces.ui.behavior.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)
        	com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187)
        	javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
        	com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:166)
        	com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
        	com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
        	com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:320)
        	com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:379)
        	com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:358)
        	com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
        	com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)
        	javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        	com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:166)
        	com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
        	com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
        	com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:320)
        	com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:379)
        	com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:358)
        	com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
        	com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)
        	javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        	com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:106)
        	com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178)
        	com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395)
        	com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366)
        	com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:111)
        	javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        	javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
        	org.richfaces.ui.behavior.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)
        	com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187)
        	javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
        	javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        	com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
        	javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
        	com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
        	com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:320)
        	com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:379)
        	com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:358)
        	com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
        	com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155)
        	com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
        	com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
        	com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:164)
        	com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:902)
        	com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
        	com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        	com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
        	org.richfaces.demo.arrangeablemodel.PersistenceLifecycle.render(PersistenceLifecycle.java:66)
        	javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
        	org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:172)
        

      • works fine in RF 4.3.4.Final, there were no changes made in neither Metamer nor Showcase since 4.3.4.Final release

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            lfryc Lukáš Fryč added a comment -

            Note that this works correctly on WildFly 8.0.0.CR1.

            Show
            lfryc Lukáš Fryč added a comment - Note that this works correctly on WildFly 8.0.0.CR1.
            Hide
            lfryc Lukáš Fryč added a comment -

            It worked with AS 7.1.1.Final with RichFaces 5.0.0.Alpha2.

            Show
            lfryc Lukáš Fryč added a comment - It worked with AS 7.1.1.Final with RichFaces 5.0.0.Alpha2.
            Hide
            lfryc Lukáš Fryč added a comment - - edited

            By binary search I have discovered that the commit from Alpha2..master changes that caused this bug is RF-13432: upgrade Mojarra and JBoss JSF to 2.2.4.

            It seems that the bug is caused by simply switching the JSF version against which is RichFaces 5 compiled!

            Note that the JSF version which is used to run the project is always same (bundled in JBoss AS).

            I have no idea how that can happen.

            Hints:
            1) Can CDK produce different output based on JSF impl?

            Show
            lfryc Lukáš Fryč added a comment - - edited By binary search I have discovered that the commit from Alpha2..master changes that caused this bug is RF-13432: upgrade Mojarra and JBoss JSF to 2.2.4 . It seems that the bug is caused by simply switching the JSF version against which is RichFaces 5 compiled! Note that the JSF version which is used to run the project is always same (bundled in JBoss AS). — I have no idea how that can happen. Hints: 1) Can CDK produce different output based on JSF impl?
            Hide
            lfryc Lukáš Fryč added a comment - - edited

            Seems that CDK output (target/generated-sources) is same, no matter which commit is used (pre-upgrade, post-upgrade).

            Show
            lfryc Lukáš Fryč added a comment - - edited Seems that CDK output ( target/generated-sources ) is same, no matter which commit is used (pre-upgrade, post-upgrade).
            Hide
            lfryc Lukáš Fryč added a comment -

            Further, I have verified that the problem is in compiled richfaces.jar, not the components-demo.war archive.

            Show
            lfryc Lukáš Fryč added a comment - Further, I have verified that the problem is in compiled richfaces.jar , not the components-demo.war archive.
            Hide
            lfryc Lukáš Fryč added a comment -

            By comparison of richfaces.jar archives pre- and post-upgrade, I have found that there are very few changes:

            pom.properties
            MANIFEST.MF
            faces-config.xml -- the change is just in two elements switched the order, no functional difference

            but most significantly

            ActionListenerHandler.class
            ItemChangeListener.class
            PanelToggleListenerHandler.class

            Show
            lfryc Lukáš Fryč added a comment - By comparison of richfaces.jar archives pre- and post-upgrade, I have found that there are very few changes: pom.properties MANIFEST.MF faces-config.xml -- the change is just in two elements switched the order, no functional difference but most significantly ActionListenerHandler.class ItemChangeListener.class PanelToggleListenerHandler.class
            Hide
            lfryc Lukáš Fryč added a comment - - edited

            By de-compiling ActionListenerHandler source from class-file, I have found following difference:

            pre-upgrade

            FaceletContext ctx =
              (FaceletContext)context.getAttributes().get("com.sun.faces.facelets.FACELET_CONTEXT");
            

            post-upgrade

            FaceletContext ctx =
              (FaceletContext)context.getAttributes().get("javax.faces.FACELET_CONTEXT");
            

            Seems that the compiler is inlining a reference to FaceletContext.FACELET_CONTEXT_KEY, which is different in each JSF API artifact.

            Show
            lfryc Lukáš Fryč added a comment - - edited By de-compiling ActionListenerHandler source from class-file, I have found following difference: pre-upgrade FaceletContext ctx = (FaceletContext)context.getAttributes().get("com.sun.faces.facelets.FACELET_CONTEXT"); post-upgrade FaceletContext ctx = (FaceletContext)context.getAttributes().get("javax.faces.FACELET_CONTEXT"); Seems that the compiler is inlining a reference to FaceletContext.FACELET_CONTEXT_KEY , which is different in each JSF API artifact.
            Hide
            lfryc Lukáš Fryč added a comment - - edited

            The proper fix would be Mojarra making sure that the constant isn't inlined.
            That mechanism is future-proof.


            We can make sure to make this work simply by using reflection.

            Show
            lfryc Lukáš Fryč added a comment - - edited The proper fix would be Mojarra making sure that the constant isn't inlined . That mechanism is future-proof. We can make sure to make this work simply by using reflection.
            Hide
            lfryc Lukáš Fryč added a comment -

            I have reported the issue upstream:
            https://java.net/jira/browse/JAVASERVERFACES-3155

            Show
            lfryc Lukáš Fryč added a comment - I have reported the issue upstream: https://java.net/jira/browse/JAVASERVERFACES-3155
            Hide
            ppitonak Pavol Pitonak added a comment -

            Verified in 5.0.0-SNAPSHOT. We'll close this issue after you backport to 4.5.

            Show
            ppitonak Pavol Pitonak added a comment - Verified in 5.0.0-SNAPSHOT. We'll close this issue after you backport to 4.5.
            Hide
            bleathem Brian Leathem added a comment -

            Nice investigative work Lukáš Fryč!

            Show
            bleathem Brian Leathem added a comment - Nice investigative work Lukáš Fryč !
            Hide
            lfryc Lukáš Fryč added a comment -

            Fixed in 4.5.x as well.

            Show
            lfryc Lukáš Fryč added a comment - Fixed in 4.5.x as well.
            Hide
            jhuska Juraj Húska added a comment -

            Verified also on 4.5.0-SNAPSHOT. Closing.

            Show
            jhuska Juraj Húska added a comment - Verified also on 4.5.0-SNAPSHOT. Closing.

              People

              • Assignee:
                lfryc Lukáš Fryč
                Reporter:
                ppitonak Pavol Pitonak
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development