9 Replies Latest reply on Jul 4, 2007 12:54 PM by Julian Gonzalez

    Starting with richfaces

    Julian Gonzalez Newbie

      Hi everyone, I'm working on a JSF project and I'm already using Ajax4JSF and now I'd like to try RichFaces but I have a problem.

      I copyed the "richfaces-3.0.x.jar" file into the "WEB-INF/lib" folder of my application and I addedd this tag:

      <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>

      But when I try some rich component I get this error: (seems to be a problem getting the uri)

      GRAVE: Servlet.service() para servlet Faces Servlet lanzó excepción
      java.lang.NullPointerException
       at
      org.ajax4jsf.framework.resource.InternetResourceBase.getDataToStore(InternetResourceBase.java:229)
       at
      org.ajax4jsf.framework.resource.InternetResourceBase.getUri(InternetResourceBase.java:211)
       at
      org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase.getUrisSet(HeaderResourcesRendererBase.java:98)
       at
      org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase.getHeaderStyles(HeaderResourcesRendererBase.java:71)
       at
      org.ajax4jsf.framework.ajax.AjaxContext.processHeadResources(AjaxContext.java:442)
       at
      org.ajax4jsf.framework.ajax.AjaxContext.processHeadResources(AjaxContext.java:455)
       at
      org.ajax4jsf.framework.ajax.AjaxContext.processHeadResources(AjaxContext.java:366)
       at
      org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:258)
       at
      com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
       at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at
      org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
       at
      org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
       at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
       at
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
       at
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
       at java.lang.Thread.run(Unknown Source)
      
      






      This is my web.xml, hope someone can help me thank you very much!


      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      
      
       <context-param>
       <param-name>javax.faces.CONFIG_FILES</param-name>
       <param-value>/WEB-INF/faces-config.xml</param-value>
       </context-param>
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>0</load-on-startup>
       </servlet>
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.faces</url-pattern>
       </servlet-mapping>
      
      
       <context-param>
       <param-name>org.ajax4jsf.SKIN</param-name>
       <param-value>blueSky</param-value>
       </context-param>
      
      <filter>
       <display-name>Ajax4jsf Filter</display-name>
       <filter-name>ajax4jsf</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>
      <filter-mapping>
       <filter-name>ajax4jsf</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>FORWARD</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>
      
      
      </web-app>


        • 1. Re: Starting with richfaces
          Ilya Shaikovsky Master

          I'm not able to see Faces Servlet defined in your web.xml or you just skipped it?

          • 2. Re: Starting with richfaces
            Julian Gonzalez Newbie

             

            "ilya_shaikovsky" wrote:
            I'm not able to see Faces Servlet defined in your web.xml or you just skipped it?


            No. it's here:

            
             <servlet>
             <servlet-name>Faces Servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>0</load-on-startup>
             </servlet>
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.faces</url-pattern>
             </servlet-mapping>
            
            


            • 3. Re: Starting with richfaces
              Ilya Shaikovsky Master

              Sorry.. :)

              What is your environment? JSF and RF libraries versions?

              • 4. Re: Starting with richfaces
                Julian Gonzalez Newbie

                 

                "ilya_shaikovsky" wrote:
                Sorry.. :)

                What is your environment? JSF and RF libraries versions?



                I'm using:

                + MyEclipse 5.1.1
                + Sun JSF Reference Implementation 1.1.01
                + ajax4jsf-1.1.0.jar
                + oscache-2.3.2.jar
                + richfaces-3.0.1.jar

                I think the problem is the RichFaces uri, look the example and the stack trace please:

                <%@ page language="java" pageEncoding="UTF-8"%>
                <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
                <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
                <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
                <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
                
                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
                <html>
                <head>
                 <title> Trying....</title>
                </head>
                
                <body>
                 <f:view>
                
                 <rich:tabPanel>
                 <rich:tab label="First">
                
                 </rich:tab>
                 <rich:tab label="Second">
                
                 </rich:tab>
                 <rich:tab label="Third">
                
                 </rich:tab>
                 </rich:tabPanel>
                
                 </f:view>
                </body>
                </html>
                



                GRAVE: El Servlet.service() para servlet jsp lanzó una excepción
                java.lang.NullPointerException
                 at org.ajax4jsf.framework.resource.InternetResourceBase.getDataToStore(InternetResourceBase.java:229)
                 at org.ajax4jsf.framework.resource.InternetResourceBase.getUri(InternetResourceBase.java:211)
                 at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeBegin(TabPanelRenderer.java:185)
                 at org.richfaces.renderkit.html.TabPanelRenderer.doEncodeBegin(TabPanelRenderer.java:180)
                 at org.ajax4jsf.framework.renderer.RendererBase.encodeBegin(RendererBase.java:97)
                 at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:675)
                 at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:584)
                 at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:536)
                 at org.apache.jsp.prueba_jsp._jspx_meth_rich_005ftabPanel_005f0(prueba_jsp.java:162)
                 at org.apache.jsp.prueba_jsp._jspx_meth_f_005fview_005f0(prueba_jsp.java:116)
                 at org.apache.jsp.prueba_jsp._jspService(prueba_jsp.java:80)
                 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
                 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
                 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
                 at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
                 at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
                 at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
                 at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
                 at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
                 at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                 at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
                 at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
                 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
                 at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
                 at java.lang.Thread.run(Unknown Source)
                


                • 5. Re: Starting with richfaces
                  Ilya Shaikovsky Master

                  please try to download Rich Faces 3.0.1 Release with the ajax4jsf bundled and use it.

                  • 6. Re: Starting with richfaces
                    Ilya Shaikovsky Master

                    B.t.w. I do not think it is the problem but suggest you not to use jsf 1.1_01 because of known bugsw. Use at least 1.1_02 with the fixes.

                    • 7. Re: Starting with richfaces
                      Julian Gonzalez Newbie

                      If I use ajax4jsf-1.1.1.jar y got the following error starting Tomcat 6.0.1

                      INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Programas\MyEclipse\bin;C:\Programas\apache-tomcat-6.0.10\bin
                      04-jul-2007 17:23:54 org.apache.coyote.http11.Http11Protocol init
                      INFO: Inicializando Coyote HTTP/1.1 en puerto http-8080
                      04-jul-2007 17:23:54 org.apache.catalina.startup.Catalina load
                      INFO: Initialization processed in 1406 ms
                      04-jul-2007 17:23:54 org.apache.catalina.core.StandardService start
                      INFO: Arrancando servicio Catalina
                      04-jul-2007 17:23:54 org.apache.catalina.core.StandardEngine start
                      INFO: Starting Servlet Engine: Apache Tomcat/6.0.10
                      04-jul-2007 17:23:56 org.apache.catalina.core.ApplicationContext log
                      INFO: ContextListener: contextInitialized()
                      04-jul-2007 17:23:56 org.apache.catalina.core.ApplicationContext log
                      INFO: SessionListener: contextInitialized()
                      log4j:WARN No appenders could be found for logger (com.sun.faces.config.ConfigureListener).
                      log4j:WARN Please initialize the log4j system properly.
                      04-jul-2007 17:24:04 org.apache.catalina.core.StandardContext filterStart
                      GRAVE: Excepción arrancando filtro ajax4jsf
                      java.lang.NoClassDefFoundError: org/apache/commons/collections/map/LRUMap
                       at java.lang.ClassLoader.defineClass1(Native Method)
                       at java.lang.ClassLoader.defineClass(Unknown Source)
                       at java.security.SecureClassLoader.defineClass(Unknown Source)
                       at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1815)
                       at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
                       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
                       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
                       at java.lang.ClassLoader.loadClassInternal(Unknown Source)
                       at org.ajax4jsf.cache.LRUMapCacheFactory.createCache(LRUMapCacheFactory.java:49)
                       at org.ajax4jsf.framework.resource.InternetResourceService.init(InternetResourceService.java:106)
                       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.init(BaseFilter.java:149)
                       at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
                       at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
                       at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
                       at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)
                       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
                       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
                       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
                       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
                       at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
                       at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
                       at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
                       at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
                       at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
                       at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
                       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1023)
                       at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
                       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
                       at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
                       at org.apache.catalina.core.StandardService.start(StandardService.java:448)
                       at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
                       at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                       at java.lang.reflect.Method.invoke(Unknown Source)
                       at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
                       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
                      04-jul-2007 17:24:04 org.apache.catalina.core.StandardContext start
                      GRAVE: Error filterStart
                      04-jul-2007 17:24:04 org.apache.catalina.core.StandardContext start
                      GRAVE: Falló en arranque del Contexto [/jgroig] debido a errores previos
                      04-jul-2007 17:24:05 org.apache.coyote.http11.Http11Protocol start
                      INFO: Arrancando Coyote HTTP/1.1 en puerto http-8080
                      04-jul-2007 17:24:06 org.apache.jk.common.ChannelSocket init
                      INFO: JK: ajp13 listening on /0.0.0.0:8009
                      04-jul-2007 17:24:06 org.apache.jk.server.JkMain start
                      INFO: Jk running ID=0 time=0/78 config=null
                      04-jul-2007 17:24:06 org.apache.catalina.startup.Catalina start
                      INFO: Server startup in 11422 ms
                      
                      


                      • 8. Re: Starting with richfaces
                        Ilya Shaikovsky Master

                        please update your common-collections to latest version.

                        • 9. Re: Starting with richfaces
                          Julian Gonzalez Newbie

                           

                          "ilya_shaikovsky" wrote:
                          please update your common-collections to latest version.


                          I tried ajax4jsf-1.1.0 with richfaces-3.0.0 and It worked!!!!!

                          Now I will upgrade commons-collections to 3.2 and try ajax4jsf-1.1.1 with richfaces-3.0.1

                          Thank you very much ilya_shaikovsky ;-)