7 Replies Latest reply on Apr 3, 2012 6:56 AM by haroonfoad

    JSF1.2 with JBoss 7.0.2.Final

    haroonfoad

      Dear Developers,

      We have old projects built on top of JBoss4.2.1.GA.

      In these projects we used JSF1.2.

      Is there any possibility to run those applications on JBoss7.0.2.Final or JBoss AS7 in general ?

      If yes, how?, If no, what should I do to run them on JBoss AS7?

       

      Thanks.

        • 1. Re: JSF1.2 with JBoss 7.0.2.Final
          ssilvert

          AS7 ships with JSF 1.2.  See Deploying Simple JSF 1.2 application in jboss 7

           

          Stan

          • 2. Re: JSF1.2 with JBoss 7.0.2.Final
            haroonfoad

            Thank you Mr.Silvert.

            But what about using richfaces 3.3.3.Final with JSF1.2 on JBoss AS7.

            How to configure it ?

            Thanks.

            • 3. Re: JSF1.2 with JBoss 7.0.2.Final
              ssilvert

              The fact that it's running on AS7 shouldn't make any difference beyond adding the context param.  If you are having trouble I suggest that you ask your RichFaces 3.3.3 + JSF 1.2 questions on the RichFaces forum.  The RichFaces guys should be able to help you over there.

               

              Stan

              • 4. Re: JSF1.2 with JBoss 7.0.2.Final
                haroonfoad

                This is the error I face when I first run the main page.

                HTTP Status 500 -


                type Exception report

                message

                description The server encountered an internal error () that prevented it from fulfilling this request.

                exception

                javax.servlet.ServletException: Illegal attempt to set ViewHandler after a response has been rendered. javax.faces.webapp.FacesServlet.service(FacesServlet.java:606) org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) 

                 

                root cause

                java.lang.IllegalStateException: Illegal attempt to set ViewHandler after a response has been rendered. com.sun.faces.application.ApplicationImpl.setViewHandler(ApplicationImpl.java:562) org.ajax4jsf.event.InitPhaseListener.beforePhase(InitPhaseListener.java:92) com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99) com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116) com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
                • 5. Re: JSF1.2 with JBoss 7.0.2.Final
                  haroonfoad

                  And this is from the server.log

                  ===========================

                  10:09:25,926 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/wessal].[Faces Servlet]] (http--127.0.0.1-8080-2) Servlet.service() for servlet Faces Servlet threw exception: java.lang.IllegalStateException: Illegal attempt to set ViewHandler after a response has been rendered.

                            at com.sun.faces.application.ApplicationImpl.setViewHandler(ApplicationImpl.java:562) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                            at org.ajax4jsf.event.InitPhaseListener.beforePhase(InitPhaseListener.java:92) [richfaces-impl-3.3.3.Final.jar:]

                            at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                            at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

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

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

                            at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) [richfaces-impl-3.3.3.Final.jar:]

                            at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) [richfaces-impl-3.3.3.Final.jar:]

                            at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) [richfaces-impl-3.3.3.Final.jar:]

                            at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) [richfaces-impl-3.3.3.Final.jar:]

                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

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

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

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

                            at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

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

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

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

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

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

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

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

                            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                            at java.lang.Thread.run(Thread.java:662) [:1.6.0_30]

                  • 6. Re: JSF1.2 with JBoss 7.0.2.Final
                    haroonfoad

                    Dear Mr.Silvert,

                    when I deleted this line from faces-config.xml

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

                    and added

                         <view-handler>org.ajax4jsf.application.AjaxViewHandler</view-handler>

                     

                    And also added this context-param in web.xml

                         <context-param>

                            <param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name>

                            <param-value>Mojarra-1.2</param-value>

                        </context-param>

                     

                    I got no error , but my jsf and richfaces code are not parsed at all .

                    I got an empty page.

                     

                    Any help will be appreciated.

                    • 7. Re: JSF1.2 with JBoss 7.0.2.Final
                      haroonfoad

                      I solved my problem using these steps:

                      1.

                      delete this line from faces-config.xml

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

                      and add this line instead.

                           <view-handler>org.ajax4jsf.application.AjaxViewHandler</view-handler>

                       

                      2.Correct the version of the jsf1.2 in the POM.xml to be suited with JBoss as7.0.1 like this

                               <dependency>

                                  <groupId>javax.faces</groupId>

                                  <artifactId>jsf-api</artifactId>

                                  <version>1.2_15</version>

                                  <scope>provided</scope>

                              </dependency>

                       

                       

                              <dependency>

                                  <groupId>javax.faces</groupId>

                                  <artifactId>jsf-impl</artifactId>

                                  <version>1.2_15</version>

                                  <scope>provided</scope>

                              </dependency>

                       

                      3. Add this dependecy to pom.xml

                      <dependency>

                                  <groupId>com.sun.facelets</groupId>

                                  <artifactId>jsf-facelets</artifactId>

                                  <version>1.1.15.B1</version>

                                  <scope>compile</scope>

                              </dependency>

                      4. Add this context parameter to the web.xml

                      <context-param>

                              <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>

                              <param-value>true</param-value>

                          </context-param>

                       

                      And that's it.

                       

                       

                            

                      Thanks all.