10 Replies Latest reply on Oct 23, 2008 4:32 AM by ilya_shaikovsky

    Problem setting up RichFaces with Tomcat 6.0.18

      Hi there,

      I've got a Tomcat 6.0.18 together with JDK 1.5 and 1.6. up and running. Sun's JSF reference implementation with version 1.2. works properly.

      Now I tried Richfaces. However, I cannot start the Tomcat Server. I always get the following error:

      [...]
      07.09.2008 23:08:47 org.apache.coyote.http11.Http11Protocol init
      INFO: Initializing Coyote HTTP/1.1 on http-8080
      07.09.2008 23:08:47 org.apache.catalina.startup.Catalina load
      INFO: Initialization processed in 463 ms
      07.09.2008 23:08:47 org.apache.catalina.core.StandardService start
      INFO: Starting service Catalina
      07.09.2008 23:08:47 org.apache.catalina.core.StandardEngine start
      INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
      07.09.2008 23:08:48 org.apache.catalina.core.StandardContext addApplicationListener
      INFO: The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.
      07.09.2008 23:08:48 com.sun.faces.config.ConfigureListener contextInitialized
      INFO: Initializing Sun's JavaServer Faces implementation (1.2_04-b10-p01) for context '/richfaces'
      07.09.2008 23:08:48 org.apache.catalina.core.StandardContext start
      SCHWERWIEGEND: Error listenerStart

      07.09.2008 23:08:48 org.apache.catalina.core.StandardContext start
      SCHWERWIEGEND: Context [/richfaces] startup failed due to previous errors

      07.09.2008 23:08:49 com.sun.faces.config.ConfigureListener contextInitialized
      INFO: Initializing Mojarra (1.2_09-b02-FCS) for context '/jsfbasics'
      [...]


      I have the follwing JARs in my /WEB-INF/lib directory:

      jbos-faces.jar, 4.2.0.GA

      jsf-api.jar, Specification-Vendor: JBoss (http://www.jboss.org/)
      Specification-Version: 1.2MR1

      jsf-impl.jar, Specification-Vendor: JBoss (http://www.jboss.org/), Specification-Version: 1.2MR1

      richfaces-api-3.2.1.GA.jar, 3.2.1.GA

      richfaces-impl-3.2.1.GA.jar, 3.2.1.GA

      richfaces-ui-3.2.1.GA.jar, 3.2.1.GA

      And this is how my web.xml looks like:

      <?xml version="1.0"?>
      <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      <display-name>a4jEchoText</display-name>
      <context-param>
      <param-name>org.richfaces.SKIN</param-name>
      <param-value>blueSky</param-value>
      </context-param>
      <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>server</param-value>
      </context-param>

      <display-name>RichFaces Filter</display-name>
      <filter-name>richfaces</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>

      <filter-mapping>
      <filter-name>richfaces</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      REQUEST
      FORWARD
      INCLUDE
      </filter-mapping>

      <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

      <!-- Faces Servlet -->

      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>

      <!-- Faces Servlet Mapping -->
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>
      <login-config>
      <auth-method>BASIC</auth-method>
      </login-config>
      </web-app>


      I hope there is anybody out there who can help me with this issue. Any help will be appreciated.

      Regards,

      Christian

        • 1. Re: Problem setting up RichFaces with Tomcat 6.0.18

          I've just enabled logging and this is the error in more detail:

          java.lang.UnsupportedOperationException
          at com.sun.faces.config.ConfigureListener$InitFacesContext.getViewRoot(ConfigureListener.java:1690)
          at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:113)
          at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:277)
          at com.sun.faces.util.Util.createInstance(Util.java:477)
          at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:635)
          at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:503)
          at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:402)
          at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
          at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
          at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
          at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
          at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
          at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
          at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
          at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
          at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
          at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
          at org.apache.catalina.core.StandardService.start(StandardService.java:516)
          at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
          at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)


          So, what is wrong here?

          • 2. Re: Problem setting up RichFaces with Tomcat 6.0.18
            ilya_shaikovsky

            seems you use jdk 1.4. 1.5 and higher should be used in your environment.

            • 3. Re: Problem setting up RichFaces with Tomcat 6.0.18
              ilya_shaikovsky

              sorry skipped first post description,.

              Additionally:

              1) make sure that you has no el-* libs in your projects libraries folder.

              2) make sure you defined

              <context-param> <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name> <param-value>true</param-value> </context-param>
              

              in your web.xml while using JBoss 4.2.0 and higher and using JSF libs inside project jars.

              • 4. Re: Problem setting up RichFaces with Tomcat 6.0.18
                suckerd

                Mhh try to comment out the following line:

                <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
                


                CU Mike

                • 5. Re: Problem setting up RichFaces with Tomcat 6.0.18

                  First of all, thanks for your help.

                  Unfortunately, all the above mentioned suggestions doesn't make RichFace with Tomcat running.

                  1) I've deleted el-api.jar and jasper-el.jar from my Tomcat installed lib-directory. These are the files that are currently in this directory:

                  annotations-api.jar
                  catalina-ant.jar
                  catalina-ha.jar
                  catalina-tribes.jar
                  catalina.jar
                  jasper-jdt.jar
                  jasper.jar
                  jsp-api.jar
                  servlet-api.jar
                  tomcat-coyote.jar
                  tomcat-dbcp.jar
                  tomcat-i18n-es.jar
                  tomcat-i18n-fr.jar
                  tomcat-i18n-ja.jar


                  Within the war file for the richface apliaction I have only the above mentioned files in my lib-directory:

                  jbos-faces.jar, 4.2.0.GA
                  jsf-api.jar, Specification-Vendor: JBoss (http://www.jboss.org/)
                  Specification-Version: 1.2MR1
                  jsf-impl.jar, Specification-Vendor: JBoss (http://www.jboss.org/), Specification-Version: 1.2MR1
                  richfaces-api-3.2.1.GA.jar, 3.2.1.GA
                  richfaces-impl-3.2.1.GA.jar, 3.2.1.GA
                  richfaces-ui-3.2.1.GA.jar, 3.2.1.GA


                  2) My web.xml is looking like this now:

                  <?xml version="1.0"?>
                  <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
                  <display-name>a4jEchoText</display-name>
                  <context-param>
                  <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
                  <param-value>true</param-value>
                  </context-param>
                  <context-param>
                  <param-name>org.richfaces.SKIN</param-name>
                  <param-value>blueSky</param-value>
                  </context-param>
                  <context-param>
                  <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                  <param-value>server</param-value>
                  </context-param>

                  <display-name>RichFaces Filter</display-name>
                  <filter-name>richfaces</filter-name>
                  <filter-class>org.ajax4jsf.Filter</filter-class>

                  <filter-mapping>
                  <filter-name>richfaces</filter-name>
                  <servlet-name>Faces Servlet</servlet-name>
                  REQUEST
                  FORWARD
                  INCLUDE
                  </filter-mapping>
                  <!-- Faces Servlet -->

                  <servlet-name>Faces Servlet</servlet-name>
                  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                  <load-on-startup>1</load-on-startup>

                  <!-- Faces Servlet Mapping -->
                  <servlet-mapping>
                  <servlet-name>Faces Servlet</servlet-name>
                  <url-pattern>*.jsf</url-pattern>
                  </servlet-mapping>
                  <login-config>
                  <auth-method>BASIC</auth-method>
                  </login-config>
                  </web-app>


                  However, my Tomcat is still not running smoothly and prints out the same error-message. Any more ideas what's wrong here?

                  Regards,

                  Christian


                  • 6. Re: Problem setting up RichFaces with Tomcat 6.0.18
                    suckerd

                    Hi Christian,

                    could you check the richfaces-demo application from here:
                    http://repository.jboss.com/maven2/org/richfaces/samples/richfaces-demo/3.2.1.GA/richfaces-demo-3.2.1.GA-tomcat6.war

                    and compare the config/jar-files !?

                    Cheers,

                    Mike

                    • 7. Re: Problem setting up RichFaces with Tomcat 6.0.18

                      I will give it a try and come back with a feedback later. Thanks for your help so far.

                      • 8. Re: Problem setting up RichFaces with Tomcat 6.0.18

                        I've just downaloded the above mentiuoned ricfaces-demo-application and it works perfectly. Thank you so far.

                        • 9. Re: Problem setting up RichFaces with Tomcat 6.0.18
                          tutyrichard

                          Hi

                          I tried the http://repository.jboss.com/maven2/org/richfaces/samples/richfaces-demo/3.2.2.GA/richfaces-demo-3.2.2.GA-tomcat6.war following sample to deploy in tomcat 6.0.18. but its not working. Can any one suggest what could be the problem. I am getting the following error while starting the tomcat. SEVERE: Context [/richfaces-demo-3.2.2.GA] startup failed due to previous errors

                          • 10. Re: Problem setting up RichFaces with Tomcat 6.0.18
                            ilya_shaikovsky

                            Guys we ignore user cases in this forum because is designed for future features/components implementation discussions.