5 Replies Latest reply on Sep 23, 2010 6:42 PM by Marcel Kolsteren

    Facelets: faces servlet not invoked (unprocessed XHTML shown)

    Karsten Wutzke Expert

      I'm referring to the config posted here before:


      http://seamframework.org/Community/ManuallyConfiguringSeamFaceletsOnTomcat6ConfigurationExceptionCausedByInstantiationException


      I'm not sure why the Facelet servlet isn't invoked. I checked the Tomcat logs, but there are no errors.


      There is the file list-clubs.xhtml in the bbstats.war root, resulting in http://localhost:8080/bbstats/list-clubs.seam, but it is just showing me the unprocessed XHTML file with the ui tags still in there.


      Any clues why the Faces servlet isn't invoked?


      Karsten

        • 1. Re: Facelets: faces servlet not invoked (unprocessed XHTML shown)
          Marcel Kolsteren Apprentice

          What are the current contents of your web.xml and faces-config.xml?

          • 2. Re: Facelets: faces servlet not invoked (unprocessed XHTML shown)
            Karsten Wutzke Expert

            Mojarra is getting initialized:


            23.09.2010 23:31:49 com.sun.faces.config.ConfigureListener contextInitialized
            INFO: Initializing Mojarra (1.2_12-b01-FCS) for context '/bbstats'



            Anyway, you asked for the files, so here they are.


            faces-config.xml:


            <faces-config version="1.2"
                          xmlns="http://java.sun.com/xml/ns/javaee"
                          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
            
              <!-- Facelets -->
              <application>
                <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
              </application>
                
            </faces-config>



            web.xml:


            <?xml version="1.0" encoding="UTF-8"?>
            <web-app version="2.5"
                     xmlns="http://java.sun.com/xml/ns/javaee"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
            
              <display-name>Basketball Stats</display-name>
              <description>Basketball Stats Web Application</description>
            
              <!-- Context description -->
              <context-param>
                <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                <param-value>.xhtml</param-value>
              </context-param>
            
              <!-- Basketball Stats Servlet -->
              <servlet>
                <servlet-name>Basketball Stats Servlet</servlet-name>
                <servlet-class>com.kawoolutions.bbstats.servlet.BasketballStatsServlet</servlet-class>
                <load-on-startup>5</load-on-startup>
              </servlet>
            
              <servlet-mapping>
                <servlet-name>Basketball Stats Servlet</servlet-name>
                <url-pattern>/home</url-pattern>
              </servlet-mapping>
            
              <!-- Faces Servlet -->
              <servlet>
                <servlet-name>Faces Servlet</servlet-name>              
                <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>              
                <load-on-startup>1</load-on-startup>
              </servlet>    
                   
              <servlet-mapping>
                <servlet-name>Faces Servlet</servlet-name>              
                <url-pattern>*.seam</url-pattern>
              </servlet-mapping>
              
              <!-- Seam Listener -->
              <listener>
                <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
              </listener>
            
              <!-- Session config -->
              <session-config>
                <session-timeout>30</session-timeout>
              </session-config>
            
            </web-app>



            Karsten

            • 3. Re: Facelets: faces servlet not invoked (unprocessed XHTML shown)
              Marcel Kolsteren Apprentice

              That seems ok. I suppose the files are in the correct path? WEB-INF/web.xml and WEB-INF/faces-config.xml?


              Maybe the problem is the list-clubs.xhtml file then? Did you already try to reduce it to a very basic hello world page?

              • 4. Re: Facelets: faces servlet not invoked (unprocessed XHTML shown)
                Karsten Wutzke Expert

                I just realized from your comment that I forgot to add the faces-config.xml to my Ant build.xml. The war task call now contains


                <webinf dir="${xml.dir}" includes="web.xml,faces-config.xml" />
                



                I now get some StackOverflowError:


                java.lang.StackOverflowError
                    java.util.Arrays.copyOf(Unknown Source)
                    java.util.Arrays.copyOf(Unknown Source)
                    java.util.ArrayList.toArray(Unknown Source)
                    java.util.ArrayList.addAll(Unknown Source)
                    com.sun.facelets.impl.DefaultFaceletContext.<init>(DefaultFaceletContext.java:73)
                    com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:337)
                    com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:307)
                    com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
                    com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
                    com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
                    com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
                    com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
                    com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
                    com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
                    com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
                    com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
                    com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
                    com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
                    com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
                    com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
                    com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
                    com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
                    com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
                    com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:65)
                    com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:73)
                    com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
                    com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
                    com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
                    com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
                    com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
                    com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
                    com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
                    ...
                



                but that at least shows me the faces servlet get invoked, right?


                I have to check the XHTML files, looks like I managed to put in a recursion.


                Thanks again,


                Karsten

                • 5. Re: Facelets: faces servlet not invoked (unprocessed XHTML shown)
                  Marcel Kolsteren Apprentice

                  That indeed looks like a recursion. You probably made a mistake by including a page into itself with the ui:include tag.