7 Replies Latest reply on Aug 25, 2009 4:30 AM by nimo22

    packaging rf in ear

    nimo22

      I guess, I have a problem like that one:

      http://seamframework.org/Community/JavalangNoClassDefFoundErrororgrichfacescomponenthtmlHtmlInplaceSelect


      I have a EAR-Project and want to ask, if I have put the rf-jars in the right place:

      EAR->lib:
      richfaces-api-*.jar

      WAR->WEB-INF->lib:
      richfaces-impl-*.jar
      richfaces-ui-*.jar

      Did I put these jars in the right place?

        • 1. Re: packaging rf in ear
          ilya_shaikovsky

           

           HtmlInplaceSelect inplaceSelect = new HtmlInplaceSelect();
          


          causes this classloading issue. use
          FacesContext.getCurrentInstance().getApplication().createComponent(componentType)
          


          instead.


          • 2. Re: packaging rf in ear
            nimo22

            I use the component 'HtmlExtendedDataTable':

            I do not use this:

            HtmlInplaceSelect inplaceSelect = new HtmlInplaceSelect();


            I used "findComponent":

            HtmlExtendedDataTable dataTable = (HtmlExtendedDataTable) FacesContext.getCurrentInstance().getViewRoot().findComponent(component);


            and got (sporadically) this error:

            Caused by: java.lang.NoClassDefFoundError: org/richfaces/component/html/HtmlExtendedDataTable.

            However, I used "createComponent":

            HtmlExtendedDataTable dataTable = (HtmlExtendedDataTable) FacesContext.getCurrentInstance().getApplication().createComponent(component);


            and get the same error.

            But all rf-libs (rf 3.3.1) are still in the right places.

            • 3. Re: packaging rf in ear
              ilya_shaikovsky

              use UI* class instead of html*

              • 4. Re: packaging rf in ear
                nimo22

                Unfortunately, I get this error when using UIExtendedDataTable:

                UIExtendedDataTable dataTable = (UIExtendedDataTable) FacesContext.getCurrentInstance().getViewR
                oot().findComponent(component);


                Caused by: java.lang.NoClassDefFoundError: org/richfaces/component/UIExtendedDataTable


                • 5. Re: packaging rf in ear
                  nimo22

                  okay, I have solved that.

                  I had a reference of a richfaces-api.jar in my jboss server lib and also in my ear-project.

                  • 6. Re: packaging rf in ear
                    nimo22

                    no, the problem still exists. Very ugly..

                    Caused by: java.lang.NoClassDefFoundError: org/richfaces/component/UIExtendedDataTable
                     at java.lang.Class.getDeclaredMethods0(Native Method)
                     at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
                     at java.lang.Class.privateGetPublicMethods(Unknown Source)
                     at java.lang.Class.getMethods(Unknown Source)


                    My exploded EAR-Archive has definitly all required packages:

                    EAR->lib:
                    richfaces-api-3.3.1.GA.jar

                    WAR->WEB-INF->lib:
                    richfaces-impl--3.3.1.GA.jar
                    richfaces-ui--3.3.1.GA.jar

                    I have definitly no other richfaces api elsewhere in the server-lib and stopped the server, removed all tmp and work-directory before deploying the exploded archive.

                    So what is wrong.

                    • 7. Re: packaging rf in ear
                      nimo22

                      oh now, I have solved it.

                      It was a classpath-issue.