1 2 3 Previous Next 37 Replies Latest reply on Jun 24, 2013 11:42 AM by ssilvert Go to original post
      • 15. Re: Using another JSF implementation in JBoss AS 7.0.1
        bolke

        Hi Stan,

         

         

        I'm actually trying to use MyFaces 2 with an EAR. I try to do this for an application that I'm migrating from Jboss 4.2 + SEAM 2.0 + Hibernate 3 + JSF 1.2 to Jboss 7.2 (alpha of okt 16, due to other bugs in 7.1.1) + SEAM 2.3 + Hibernate 4 + JSF 2. Seam 2.3 requires Hibernate 4/JSF2. However I'm running in so many issues with Mojarra (ui:includes not working with partial updates etc etc) while Myfaces does not seem to have these issues that I'd like to try it.

         

        SEAM 2.3 references  the faces api and is packaged as an ejb in the root of the ear. Thus the classloader needs in that location and not in the WAR (I did try this).

         

        What I also tried is your jboss-pull request that allows me to overwrite module.xml from the JSF Mojarra implementation. (Was this implemented in the October 16 version of Jboss 7.2?)  However I'm stuck at this for now:

         

         

        {code}

        Caused by: java.lang.NoClassDefFoundError: com/sun/faces/application/MethodBindingMethodExpressionAdapter

                at java.lang.Class.getDeclaredConstructors0(Native Method) [rt.jar:1.7.0_06]

                at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404) [rt.jar:1.7.0_06]

                at java.lang.Class.getConstructor0(Class.java:2714) [rt.jar:1.7.0_06]

                at java.lang.Class.newInstance0(Class.java:343) [rt.jar:1.7.0_06]

                at java.lang.Class.newInstance(Class.java:325) [rt.jar:1.7.0_06]

                at org.apache.myfaces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1422) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1386) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.jboss.seam.jsf.SeamApplication.createComponent(SeamApplication.java:108) [jboss-seam-2.3.0.Final.jar:2.3.0.Final]

                at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.createComponent(ComponentTagHandlerDelegate.java:454) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:231) [myfaces-impl-2.1.8.jar:2.1.8]

                at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:53) [myfaces-api-2.1.8.jar:2.1.8]

                at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49) [myfaces-api-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:57) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:48) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:394) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:448) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:426) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:244) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:217) [myfaces-impl-2.1.8.jar:2.1.8]

                at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49) [myfaces-api-2.1.8.jar:2.1.8]

                at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:58) [myfaces-api-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate.apply(ComponentTagHandlerDelegate.java:294) [myfaces-impl-2.1.8.jar:2.1.8]

                at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:53) [myfaces-api-2.1.8.jar:2.1.8]

                at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49) [myfaces-api-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:57) [myfaces-impl-2.1.8.jar:2.1.8]

                at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:49) [myfaces-api-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:48) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:394) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:448) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:426) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:244) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:148) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:57) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:48) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:179) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.buildView(FaceletViewDeclarationLanguage.java:444) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:78) [myfaces-impl-2.1.8.jar:2.1.8]

                at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241) [myfaces-impl-2.1.8.jar:2.1.8]

                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:199) [myfaces-api-2.1.8.jar:2.1.8]

         

        {code}

         

        So I'm definitely looking forward to a more robust implementation (or any hint on what I might be doing wrong) :-)

         

        Message was edited by: Bolke de Bruin

        • 16. Re: Using another JSF implementation in JBoss AS 7.0.1
          ssilvert

          Bolke de Bruin wrote:

           

          So I'm definitely looking forward to a more robust implementation (or any hint on what I might be doing wrong) :-)

          Here is the "more robust" implementation I will be merging soon.  I just haven't had time to finish testing.

          https://github.com/ssilvert/jboss-as/tree/multijsf

           

          If you want to try it out, just let me know which JSF implementation and version you want to use.  Then I'll attach a JSF installer archive and you'll be good to go.

           

          Stan

          • 17. Re: Using another JSF implementation in JBoss AS 7.0.1
            gkar47

            Any ETA on when this will be available in a release version of AS7? I am having no luck in getting WAR_BUNDLES_JSF_IMPL to work with a WAR within an EAR. I am using AS7.1.1. I have seen others on this forum are having similar problems and I don't see anyone with a solution. I'm hoping this will be it.

            • 18. Re: Using another JSF implementation in JBoss AS 7.0.1
              ssilvert

              The design is here: Design of AS7 multi-JSF feature

               

              The code is done too.  It's just waiting to be merged.

               

              Stan

              • 19. Re: Using another JSF implementation in JBoss AS 7.0.1
                robertwalker

                the Design of AS7 multi-JSF feature is GREAT!! I would be all about using it but from what i understand, issue AS7-1628 is a show stopper for me, and i would think many.

                 

                 

                how can i use myfaces (say for example 2.1.10) and jee6/CDI together with jboss7?,

                seems like the issue AS7-1628 has been left to community to resolve, yet it seems to be a very common setup that many jb7 people would need.

                 

                can anyone elaborate on how to get these technologies to work together ?

                 

                 

                • 20. Re: Using another JSF implementation in JBoss AS 7.0.1
                  ssilvert

                  Multi-JSF is done now.  So if you can use a nightly build of AS7 then you can use it right away and AS7-1628 won't matter.  MyFaces is now completely integrated with AS7.

                   

                  Stan

                  • 21. Re: Using another JSF implementation in JBoss AS 7.0.1
                    troup

                    Hi Stan,

                     

                    This is excellent news. I found the cli file for MyFaces over on your design article:

                     

                    https://community.jboss.org/wiki/DesignOfAS7Multi-JSFFeature

                     

                    Is there any reason why installing this into a JBoss 7.1.1 final instance would not work?

                     

                    My understanding was that to integrate MyFaces with JBoss you needed spi classes. These now seems to be provided courtesy of your jboss-as-jsf-injection-7.2.0.Alpha1-SNAPSHOT.jar file. Sadly I cannot move to a nightly build so using this on JBoss 7.1.1 final would be amazing.

                     

                    Tim

                    • 22. Re: Using another JSF implementation in JBoss AS 7.0.1
                      nickarls

                      Was this supposed to resolve AS7-5849 also or is that another issue?

                      • 23. Re: Using another JSF implementation in JBoss AS 7.0.1
                        ssilvert

                        Tim Troup wrote:

                         

                        Hi Stan,

                         

                        This is excellent news. I found the cli file for MyFaces over on your design article:

                         

                        https://community.jboss.org/wiki/DesignOfAS7Multi-JSFFeature

                         

                        Is there any reason why installing this into a JBoss 7.1.1 final instance would not work?

                        It won't work in 7.1.1 because there is no JSF subsystem in 7.1.1.  In 7.2.x we added the JSF subsystem and changed the way that JSF gets added to a deployment.

                         

                         

                        Tim Troup wrote:

                         

                        My understanding was that to integrate MyFaces with JBoss you needed spi classes. These now seems to be provided courtesy of your jboss-as-jsf-injection-7.2.0.Alpha1-SNAPSHOT.jar file. Sadly I cannot move to a nightly build so using this on JBoss 7.1.1 final would be amazing.

                        Bundled MyFaces should be working now in 7.2.x with WAR_BUNDLES_JSF_IMPL.  In that case, it uses MyFaces annotation scanning.  So you end up with JBoss scanning everything and MyFaces scanning everything too. 

                         

                        That's why it's more efficient to use Multi-JSF.  With Multi-JSF, the JBoss annotation processor is integrated with MyFaces.

                         

                        I'm not sure what would happen if you bundled jboss-as-jsf-injection.jar.  I doubt that it would work, but you could try it.

                         

                        For 7.1.1, I'm pretty sure AS7-5849 still applies.

                        • 24. Re: Using another JSF implementation in JBoss AS 7.0.1
                          nickarls

                          Stan Silvert wrote:

                          For 7.1.1, I'm pretty sure AS7-5849 still applies.

                           

                          I still got it on a fresh build of upstream master when re-doing the test

                          • 25. Re: Using another JSF implementation in JBoss AS 7.0.1
                            ssilvert

                            Nicklas Karlsson wrote:

                             

                            Was this supposed to resolve AS7-5849 also or is that another issue?

                            Whether or not AS7-5849 is resolved or not depends on how you look at it.  It's resolved in 7.2.x because now it works without errors.  But bundled JSF is not actually integrated properly.  I'm not sure what all the ramifications are.  I don't spend that much time on bundled JSF because it is not officially supported and Multi-JSF covers about 99.9% of use cases.

                             

                            Stan

                            • 26. Re: Using another JSF implementation in JBoss AS 7.0.1
                              ssilvert

                              Nicklas Karlsson wrote:

                               

                              Stan Silvert wrote:

                              For 7.1.1, I'm pretty sure AS7-5849 still applies.

                               

                              I still got it on a fresh build of upstream master when re-doing the test

                              In that case I'll take another look.  I know that ordinary injection works with bundled MyFaces but there still might be problems with CDI even though Rich DiCroce said it was working for him.

                              • 27. Re: Using another JSF implementation in JBoss AS 7.0.1
                                nogotiated

                                Hi, is there any news on this? I installed myfaces 2.1.10 via cli module, but when I tried to deploy a CDI-based application I still get this error:

                                An error occured while initializing MyFaces: Class org.jboss.as.weld.webtier.jsf.WeldApplicationFactory is no javax.faces.application.ApplicationFactory: java.lang.IllegalArgumentException: Class org.jboss.as.weld.webtier.jsf.WeldApplicationFactory is no javax.faces.application.ApplicationFactory
                                • 28. Re: Using another JSF implementation in JBoss AS 7.0.1
                                  nickarls

                                  Just checking - was this on a fresh build?

                                  • 29. Re: Using another JSF implementation in JBoss AS 7.0.1
                                    ssilvert

                                    First, note that the Multi-JSF feature is for AS 7.2.  Earlier AS7 releases do not support Multi-JSF, except for the limited support given to JSF 1.2 that ships with the release.  You can still try WAR_BUNDLES_JSF_IMPL.

                                     

                                    There is a workaround.  See this comment https://community.jboss.org/wiki/DesignOfAS7Multi-JSFFeature#comment-11484

                                     

                                    Stan