9 Replies Latest reply on Sep 7, 2011 12:14 PM by zieke85

    Richfaces 4 in Netbeans

    martinfierz

      Aloha!

       

      I am using Netbeans 6.9.1, Glassfish v3, Mojarra 2.03 as my environment, and have been using PrimeFaces up to now because it supports JSF 2.0. I wanted to take a look at RF 4 milestone 5, and downloaded it. When I create a new project in Netbeans with just a "hello world" message on index.xhtml, and then include the 4 jars:

       

      • richfaces-components-api-4.0.0.20101226-M5.jar
      • richfaces-components-ui-4.0.0.20101226-M5.jar
      • richfaces-core-api-4.0.0.20101226-M5.jar
      • richfaces-core-impl-4.0.0.20101226-M5.jar

       

       

      my application already fails :-( - the output of the Glassfish server is shown below. Can anybody tell me what the problem might be?

      Also, when I tried to use the example on page 13 of the latest component reference I get an error on this line saying "The attribute event is not defined in the component's interface":

       

      <a4j:ajax event="onkeyup" render="outtext"/>

       

      has anyone else tried using RF4.0M5 on netbeans and been more successful?

       

      best regards

        Martin

       

       

       

      com.sun.faces.config.ConfigurationException:

        Source Document: jar:file:/U:/NetBeansProjects/richfaces4test/build/web/WEB-INF/lib/richfaces-core-impl-4.0.0.20101226-M5.jar!/META-INF/resource-handler.faces-config.xml

        Cause: Unable to create a new instance of 'org.richfaces.resource.ResourceHandlerImpl': java.lang.reflect.InvocationTargetException

              at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:289)

              at com.sun.faces.config.processor.ApplicationConfigProcessor.setResourceHandler(ApplicationConfigProcessor.java:748)

              at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:306)

              at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:110)

              at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:112)

              at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:110)

              at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:212)

              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:332)

              at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:220)

              at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4664)

              at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:535)

              at org.apache.catalina.core.StandardContext.start(StandardContext.java:5266)

              at com.sun.enterprise.web.WebModule.start(WebModule.java:499)

              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:928)

              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912)

              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694)

              at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1947)

              at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1619)

              at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90)

              at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)

              at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241)

              at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236)

              at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339)

              at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)

              at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)

              at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)

              at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)

              at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)

              at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)

              at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)

              at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)

              at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)

              at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)

              at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)

              at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)

              at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)

              at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)

              at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)

              at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)

              at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)

              at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)

              at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)

              at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)

              at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)

              at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)

              at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)

              at com.sun.grizzly.ContextTask.run(ContextTask.java:69)

              at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)

              at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)

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

      Caused by: java.lang.reflect.InvocationTargetException

              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

              at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

              at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:259)

              ... 49 more

      Caused by: java.lang.NoClassDefFoundError: com/google/common/base/Function

              at org.richfaces.resource.ResourceHandlerImpl.<init>(ResourceHandlerImpl.java:66)

              ... 54 more

      Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function

              at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

              at java.security.AccessController.doPrivileged(Native Method)

              at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

              at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:959)

              at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1430)

              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

              ... 55 more

        • 1. Richfaces 4 in Netbeans
          ilya_shaikovsky

          Please read about additional dependencies in distribution readme-ui.txt.  just one correction - actually validation-api is optional.

           

          if you will use maven based setup - them will be added transparently for you.

          1 of 1 people found this helpful
          • 2. Re: Richfaces 4 in Netbeans
            martinfierz

            Thank you Ilya!

             

            after adding the 3 jars cssparser-0.9.5.jar, guava-r07.jar and sac1-3.jar, the application now runs in glassfish. Nevertheless, I still have the problem that the "event" attribute is not recognized in this simple xhtml basically copied from the RF4.0 component reference (p.13 of the pdf)

             

            <a4j:ajax event="onkeyup" render="outtext" />

             

            I couldn't find the event attribute in the documentation - looks like an error?

             

            best regards

              Martin

            • 3. Re: Richfaces 4 in Netbeans
              ppitonak

              I'm using NetBeans 6.9.1 and Glassfish and RichFaces work like a charm. Yet another note... use "keyup" instead of "onkeyup" in a4j:ajax' event attribute.

               

              I created a Jira for Component reference https://issues.jboss.org/browse/RF-10199.

               

              Regards,

              Palo

              • 4. Richfaces 4 in Netbeans
                martinfierz

                Hi Palo,

                 

                I'm getting an error that the "event" attribute is not recognized; so it's not an issue of whether it's keyup or onkeyup (it makes no difference if I change that). Other things like adding a rich:calendar etc. work fine.

                 

                cheers

                  Martin

                • 5. Richfaces 4 in Netbeans
                  ppitonak

                  If you mean that it's not recognized in NetBeans, it's caused by a bug in taglib https://issues.jboss.org/browse/RF-9952 which will be fixed in 4.0.0.CR1.

                   

                  Attribute itself works fine in current trunk (r. 20977), M4 and M5. You can check http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=ajax.

                   

                  Palo

                  • 6. Re: Richfaces 4 in Netbeans
                    martinfierz

                    I have similar problems with other tags, e.g. in

                     

                    <a4j:commandButton value="Set name to Alex" reRender="rep">

                     

                    I get an error messge in Netbeans that "the attribute reRender is not defined in the component's interface" and for

                    <a4j:actionparam name="username" value="alex" assignTo="#{actionparamBean.name}"/>

                     

                    I get "the component library null doesn't contain such a component"

                     

                    the code is all copied from the 4.0M5 reference.

                     

                    best regards

                      Martin

                    • 7. Re: Richfaces 4 in Netbeans
                      ppitonak

                      Please have a look on Migration Guide http://docs.jboss.org/richfaces/latest_4_0_X/Migration_Guide/en-US/html/index.html. It will be updated before 4.0.0.Final is released but it contains a lot of useful information.

                       

                      • attribute reRender was renamed to render
                      • a4j:actionParam is now a4j:param

                       

                      Sorry for all bugs in Component Reference. It will be reviewed soon.

                       

                      For usage of components you can try our testing application Metamer http://anonsvn.jboss.org/repos/richfaces/modules/tests/metamer/trunk/application/.

                       

                      Palo

                      1 of 1 people found this helpful
                      • 8. Re: Richfaces 4 in Netbeans
                        martinfierz

                        Ilya, Pavel, thanks for the quick support! Looking forward to RC1!

                         

                        best regards

                          Martin

                        • 9. Re: Richfaces 4 in Netbeans
                          zieke85

                          Hello, first of all I'm sorry for my bad english, but I got a similar problem about richface (4.0.0 Final) attributes with netbeans 6.9. I'm trying this code:

                          <rich:panelMenu style="width:200px"

                                    mode="ajax"

                                    iconExpandedGroup="disc" iconCollapsedGroup="disc"

                                    iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"

                                    iconCollapsedTopGroup="chevronDown">

                          but NB show me the "ugly red line" in mode, iconExpandedGroup, iconCollapsedGroup, iconExpandedTopGroup, iconGroupTopPosition and iconCollapsedTopGroup (attribute style is ok) with the message "the attribute xxx is not defined in the component's interface". Compilation is ok, but when I deploy it I can't see the icons..

                           

                          I'm using other richface component and it's ok. Any ideas why is this happend?

                           

                          best regards,

                          Daniel