9 Replies Latest reply on Aug 12, 2011 12:15 AM by nitinkhekare

    JSF 1.2 in jboss 7

    nitinkhekare

      Hi

       

      I am deploying a simple jsf 1.2 application in jboss 7. It is getting deployed but the page is not getting parsed porperly.

      It is showing the same jsf tags insted of html tags in rendered page source.

       

      Can anyone help me in this problem?

       

      Attaching the war file.

       

      Thanks

        • 1. Re: JSF 1.2 in jboss 7
          jean.baldessar

          Hi Nitin,

           

          first: you are using tags that doesn't exist like <h:head> and <h:body> in your a.xhtml file.

          second: you have to define a view handler in your faces-config.xml

           

          put the facelets jar in WEB-INF/lib directory and this code in your faces-config:

           

          <application>

                  <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>

              </application>

           

          The tags like h:commandButton will be correctly rendered

          • 2. Re: JSF 1.2 in jboss 7
            nitinkhekare

            Jean Thank you for your reply

             

            I did all the changes suggested by you, and now I am getting a different error when I access the page.

             

            11:43:02,641 SEVERE [facelets.viewhandler] (http--127.0.0.1-8080-1) Error Rendering View[/a.xhtml]: javax.el.ELException: /a.xhtml: The class 'coreservlets.NavigationController' does not have the property 'doNavigation'.

                    at com.sun.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:53) [jsf-facelets.jar:]

                    at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39) [jsf-facelets.jar:]

                    at com.sun.facelets.compiler.UILeaf.encodeAll(UILeaf.java:149) [jsf-facelets.jar:]

                    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933) [jsf-api-1.2_13.jar:1.2_13-b01-FCS]

                    at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577) [jsf-facelets.jar:]

                    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110) [jsf-impl-1.2_13.jar:1.2_13-b01-FCS]

                    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) [jsf-impl-1.2_13.jar:1.2_13-b01-FCS]

                    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-1.2_13.jar:1.2_13-b01-FCS]

                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) [jsf-api-1.2_13.jar:1.2_13-b01-FCS]

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                    at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.0.Final.jar:7.0.0.Final]

                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                    at java.lang.Thread.run(Thread.java:619) [:1.6.0_13]

             

            But there is doNavigation action in coreservlets.NavigationController class.

             

            I tried by removing this action from xhtml page, the page is getting loaded after that, but still it is showing the jsf tags as it is.

             

            I dont know what is going wrong.

            • 3. Re: JSF 1.2 in jboss 7
              jean.baldessar

              did you access the page using the correct faces sufix?

              your faces servlet is configured to /*.faces so you have to access your application that way:

               

              http://localhost:8080/navigation-exercises/a.faces (not with the xhtml extension)

               

              I didn't test the navigation rules but making the changes I suggested the page were correctly rendered to me.

              • 4. Re: JSF 1.2 in jboss 7
                nitinkhekare

                Jean

                 

                Yes I am accessing the page correctly. But still it is showing me same error.

                • 5. Re: JSF 1.2 in jboss 7
                  jean.baldessar

                  Nitin, I did not find what's wrong in your second war file, but I made the same changes in the first and It worked.

                  The file its attached here, so you can use eclipse to compare with your file and see what's wrong.

                   

                  Maybe the facelets lib version, I don't know...

                  • 6. Re: JSF 1.2 in jboss 7
                    nitinkhekare

                    Thank you for your reply

                    • 7. Re: JSF 1.2 in jboss 7
                      nitinkhekare

                      It was a facelet jar problem. I just replaced jsf-facelets.jar file in my war file and it started working.

                      • 8. Re: JSF 1.2 in jboss 7
                        jean.baldessar

                        As I suspected.

                        Then I think you shoud mark the question as answered.

                        • 9. Re: JSF 1.2 in jboss 7
                          nitinkhekare

                          Actually I did try that before your reply, but forgot to post it. Marking your reply as correct answer.