4 Replies Latest reply on Apr 14, 2011 5:17 AM by nbelaevski

    what richfaces-components-ui.jar for?

    gfzhang

      We tried 4.0 final. Theapplicatoin needs to support upload file. To reference FileUploadEvent class, I need to reference richfaces-components-api.jar. I think I could also reference richfaces-components-ui.jar, so I also added it to my project.

       

      But I got the following error on the UI when launch our application:

       

      java.lang.NullPointerException
      at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
      at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
      at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
      at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
      at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:82)
      at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:744)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
      at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:373)
      at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:267)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:539)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:306)
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:323)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1719)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)

       

      If I remove "richfaces-components-ui.jar" from WEB-INF/lib, the page displayed correctly.

       

      My question is:

           Does richfaces-components-ui.jar provide any documented UI components? I want to know if we wouldn't need this jar in the future.

           Or does the above error is caused by our application's configuration? we cannot figure it out based on the above errror message. (there is no other error message in the log).

       

          We run it on Tomcat 7.0.12, Richfaces 4 final, JDK 1.6.0_24.

       

      Thanks

        • 1. what richfaces-components-ui.jar for?
          nbelaevski

          Hi Guofeng,

           

          This .jar file contains RichFaces components. Can you please post exact JSF version information?

          • 2. what richfaces-components-ui.jar for?
            gfzhang

            I tested against JSF 2.0.4-b09 and 2.0.5-b02. The same error on the Web page displayed.

             

            This issue can also be reproduced by push-demo sample using Richfaces 4.0.0.20110319-Final.

             

            The steps I did as the following:

                   1. check out 4.0.0.20110319-Final tag from your Subvision repostiory.

                    2. change the current directory to examples\push-demo

                    3. run "mvn package" to generate the war.

                    4. use a fresh tomcat 7.0.12 installation(I unzip apache-tomcat-7.0.12-windows-x86.zip to a new directory).

                    5. copy target\push-demo-4.0.0.Final to tomcat's webapps and rename it to push-demo.

                    6. lauch tomcat and open the browser (Google Chrome 12.0.712 here) to access http://localhost:8080/push-demo and play a while with it. Everything works well.

                    7. copy richfaces-components-api-4.0.0.Final and richfaces-components-ui-4.0.0.Final.jar to push-demo/WEB-INF/lib. When I open the browser to access http://localhost:8080/push-demo, the same error message as I posted above is displayed.

                    8. removing richfaces-components-ui-4.0.0.Final.jar and clean up "work" directory (or I will get an exception on the console when click "ajax" link on the page and push-demo won't work, see the exception stack [1] below).

                    9. Test it again, push-demo works well.

             

            JSF version used by push-demo is 2.0.4-b09.

             

            [1]Exception Stack:

            javax.faces.el.EvaluationException: java.lang.NullPointerException

                      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)

                      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

                      at javax.faces.component.UICommand.broadcast(UICommand.java:315)

                      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)

                      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)

                      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)

                      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)

                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)

                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                      at org.richfaces.webapp.PushFilter.doFilter(PushFilter.java:144)

                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)

                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)

                      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)

                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)

                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)

                      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)

                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)

                      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:306)

                      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:323)

                      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1719)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                      at java.lang.Thread.run(Thread.java:662)

            Caused by: java.lang.NullPointerException

                      at demo.ChatBean.say(ChatBean.java:121)

                      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:597)

                      at org.apache.el.parser.AstValue.invoke(AstValue.java:262)

                      at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)

                      at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)

                      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

                      ... 27 more

             

            I really sorry that I tried again but cannot find the way you instructed before to report the issue on your issue tracker page. If it is really an issue, I'd like to know the progress, so please add my email (guofeng@radvision.com) to it.

             

            Thanks.

            • 3. what richfaces-components-ui.jar for?
              gfzhang

              Update the above.

               

              I tried richfaces-showcase examples. I think this showcase should contains all the UI in Richfaces 4. I find that it only deployed 4 jars:

                    richfaces-components-api

                    richfaces-components-ui

                    richfaces-core-api

                    richfaces-core-impl

               

              I should not deploy richfaces-ui-common-api/ui.jar and richfaces-ui-core-api/ui.jar in my application. They might be included in the above four jars, am I right?

               

              If I only deploy the above four jars, our web application works well. Do I do it correctly?

               

              The push-demo sample deploy the Richfaces jars differently.

               

              Another question:

                 For the step 8 in my above post about cleaning up "work" directory, is it related to tomcat or push-demo sample? In a product environment,  Cleaning up the work directory before restarting tomcat might be impossible.

               

              Thanks.

              • 4. what richfaces-components-ui.jar for?
                nbelaevski

                Guofeng,

                 

                 

                You should either use richfaces-ui-components-ui/richfaces-ui-components-api or richfaces-ui-core-ui etc modules, not both in the same application. rcihfaces-ui-components-* .jar files are assembly files for all RichFaces components.