Application Server 7
  1. Application Server 7
  2. AS7-4366

Facelets and JSF composite components doesn't work together on JBoss 7.1.1.Final

    Details

    • Steps to Reproduce:
      Hide

      Any composite component that is used in association with JSF Facelets.

      Show
      Any composite component that is used in association with JSF Facelets.
    • Similar Issues:
      Show 10 results 

      Description

      Facelets and composite components doesn't work together with 7.1.1 final. Same code use to work with Jboss 7.1.0 release. Below link to the forum has all the details.
      This is a critical bug that can prevent us from migrating to 7.1.1 Final

        Activity

        Hide
        Stan Silvert
        added a comment -

        Please provide a sample app that demonstrates the problem. If I can't recreate it, I can't fix it.

        Show
        Stan Silvert
        added a comment - Please provide a sample app that demonstrates the problem. If I can't recreate it, I can't fix it.
        Hide
        Hendy Irawan
        added a comment -

        Stack overflow thread: http://stackoverflow.com/questions/9735593/nested-composite-component-broken-in-jboss-7-1-1

        Workaround :

        Valentinx in this thread ( https://community.jboss.org/message/724991 ) found a workaround.

        The idea is to put the faulty namespace declarations on the <composite:implementation> itself, so

        <!DOCTYPE html PUBLIC ...>
        <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:cc="http://java.sun.com/jsf/composite"
          xmlns:my="http://java.sun.com/jsf/composite/components/my" >
        <cc:interface />
        <cc:implementation>
             <my:nestedComponent content="a text" />
        </cc:implementation>
        </html>
        

        becomes

        <!DOCTYPE html PUBLIC ...>
        <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:cc="http://java.sun.com/jsf/composite" >
        <cc:interface />
        <cc:implementation xmlns:my="http://java.sun.com/jsf/composite/components/my">
             <my:nestedComponent content="a text" />
        </cc:implementation>
        </html>
        

        (notice the <cc:implementation xmlns:my="http://java.sun.com/jsf/composite/components/my"> tag)

        This works like a charm!

        Show
        Hendy Irawan
        added a comment - Stack overflow thread: http://stackoverflow.com/questions/9735593/nested-composite-component-broken-in-jboss-7-1-1 Workaround : Valentinx in this thread ( https://community.jboss.org/message/724991 ) found a workaround. The idea is to put the faulty namespace declarations on the <composite:implementation> itself, so <!DOCTYPE html PUBLIC ...> <html xmlns= "http: //www.w3.org/1999/xhtml" xmlns:h= "http: //java.sun.com/jsf/html" xmlns:cc= "http: //java.sun.com/jsf/composite" xmlns:my= "http: //java.sun.com/jsf/composite/components/my" > <cc: interface /> <cc:implementation> <my:nestedComponent content= "a text" /> </cc:implementation> </html> becomes <!DOCTYPE html PUBLIC ...> <html xmlns= "http: //www.w3.org/1999/xhtml" xmlns:h= "http: //java.sun.com/jsf/html" xmlns:cc= "http: //java.sun.com/jsf/composite" > <cc: interface /> <cc:implementation xmlns:my= "http: //java.sun.com/jsf/composite/components/my" > <my:nestedComponent content= "a text" /> </cc:implementation> </html> (notice the <cc:implementation xmlns:my="http://java.sun.com/jsf/composite/components/my"> tag) This works like a charm!
        Hide
        Hendy Irawan
        added a comment -

        Sample app to reproduce available at https://community.jboss.org/message/727901#727901

        Show
        Hendy Irawan
        added a comment - Sample app to reproduce available at https://community.jboss.org/message/727901#727901
        Hide
        Stan Silvert
        added a comment -

        I'm getting started on this one now. Thanks for the sample app and thanks for your patience.

        Show
        Stan Silvert
        added a comment - I'm getting started on this one now. Thanks for the sample app and thanks for your patience.
        Hide
        Stan Silvert
        added a comment -

        Hendy, I'm not seeing an error with your code. I've tried it on 7.1.0, 7.1.1, and 7.1.2. It always works. Can you take a look and tell me if you see the same thing?

        I'm attaching the WAR I got when I built your project.

        Show
        Stan Silvert
        added a comment - Hendy, I'm not seeing an error with your code. I've tried it on 7.1.0, 7.1.1, and 7.1.2. It always works. Can you take a look and tell me if you see the same thing? I'm attaching the WAR I got when I built your project.
        Hide
        Stan Silvert
        added a comment -

        Nevermind Hendy. I reproduced it using a hint from valentinx/Mo: https://community.jboss.org/message/724991#724991

        If you put a <ui:include> before the <lib:useboth> then you see the error.

        Show
        Stan Silvert
        added a comment - Nevermind Hendy. I reproduced it using a hint from valentinx/Mo: https://community.jboss.org/message/724991#724991 If you put a <ui:include> before the <lib:useboth> then you see the error.
        Hide
        Stan Silvert
        added a comment -

        Looks like this is a Mojarra 2.1.8 bug. I just downloaded a 2.1.8 snapshot and it has the same problem. Our JBoss fork is 2.1.7 plus a few commits from 2.1.8. I just hope the problem wasn't caused by a commit we otherwise need. At least I feel like I'm getting close. Just wanted to give you guys an update.

        Show
        Stan Silvert
        added a comment - Looks like this is a Mojarra 2.1.8 bug. I just downloaded a 2.1.8 snapshot and it has the same problem. Our JBoss fork is 2.1.7 plus a few commits from 2.1.8. I just hope the problem wasn't caused by a commit we otherwise need. At least I feel like I'm getting close. Just wanted to give you guys an update.
        Hide
        Stan Silvert
        added a comment -

        And it happens on Mojarra 2.2 as well.

        Show
        Stan Silvert
        added a comment - And it happens on Mojarra 2.2 as well.
        Show
        Stan Silvert
        added a comment - http://java.net/jira/browse/JAVASERVERFACES-2392
        Hide
        Christoph Thelen
        added a comment -

        Just as an addition: The same problem occurs when I use a composite component directly in a facelet. It doesn't have to be a nested composite component.
        Putting the namespace declaration in the surrounding element works here, too.

        Hope this is fixed soon, because I don't want to put this workaround in all our facelets.

        Show
        Christoph Thelen
        added a comment - Just as an addition: The same problem occurs when I use a composite component directly in a facelet. It doesn't have to be a nested composite component. Putting the namespace declaration in the surrounding element works here, too. Hope this is fixed soon, because I don't want to put this workaround in all our facelets.
        Hide
        Jorge Ortega Traverso
        added a comment - - edited

        Hi guys,

        Any update on this issue?

        I've tried a simple composite component on JBoss 7.1.1 (jsf-impl-2.1.7-jbossorg-2.jar) and it fails, but when I downgrade JSF implementation to jsf-impl-2.1.5-jbossorg-1.jar (taken from JBoss 7.1.0) it works, also works with jsf-impl 2.1.10 (taken from https://maven.java.net/content/repositories/releases/com/sun/faces/jsf-impl/2.1.10/).

        I've not tried a nested composite, sorry.

        I think I will stay on 7.1.0 while it is not officially solved by JBoss team.

        Show
        Jorge Ortega Traverso
        added a comment - - edited Hi guys, Any update on this issue? I've tried a simple composite component on JBoss 7.1.1 (jsf-impl-2.1.7-jbossorg-2.jar) and it fails, but when I downgrade JSF implementation to jsf-impl-2.1.5-jbossorg-1.jar (taken from JBoss 7.1.0) it works, also works with jsf-impl 2.1.10 (taken from https://maven.java.net/content/repositories/releases/com/sun/faces/jsf-impl/2.1.10/ ). I've not tried a nested composite, sorry. I think I will stay on 7.1.0 while it is not officially solved by JBoss team.
        Hide
        Stan Silvert
        added a comment -

        This was finally resolved in Mojarra 2.1.10. It should get pulled into the next release of AS.

        Show
        Stan Silvert
        added a comment - This was finally resolved in Mojarra 2.1.10. It should get pulled into the next release of AS.
        Hide
        Jason Greene
        added a comment -

        This is resolved in 7.2.0.Alpha1 but was not backported to 7.1, any reason?

        Show
        Jason Greene
        added a comment - This is resolved in 7.2.0.Alpha1 but was not backported to 7.1, any reason?
        Hide
        Stan Silvert
        added a comment - - edited

        It's fixed in both. I just needed to update and close this out.
        https://github.com/jbossas/jboss-as/pull/2660

        Show
        Stan Silvert
        added a comment - - edited It's fixed in both. I just needed to update and close this out. https://github.com/jbossas/jboss-as/pull/2660

          People

          • Assignee:
            Stan Silvert
            Reporter:
            Jboss fan99
          • Votes:
            12 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: