8 Replies Latest reply on May 9, 2014 7:21 AM by blabno

    Configure RichFaces for rich:tree

      I have had all sorts of problems getting the RichFaces tree control to work. When I try to bind a method to the adviseNodeOpened attribute on the tree control, I get a methodnotfound exception. I have found that one work around to this is to set the JBossWebLoader to true in the jboss-service.xml file. However, this breaks the SEAM email functionality, plus, I would prefer not to change the default JBoss configuration just to get a tree control to work. I have found this post on the old SEAM forum:


      http://jboss.com/index.html?module=bb&op=viewtopic&t=126041



      Unfortunately, I need a little help understanding his directions.


      <class-loading java2ClassLoadingCompliance="false">
      
          <loader-repository>
      
              seam.jboss.org:loader=<your-app-name>
      
              <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
      
          </loader-repository>
      
      </class-loading>



      First with the instruction for the class loader, by your-app-name does this mean the application name found in the application.xml file for my ear?


      Second:



      and add the richfaces-impl.jar to the ejb context (richfaces-api.jar and richfaces-ui.jar go into the root ear context)


      Does this mean to put the richfaces-impl.jar into my .WAR web-inf/lib directory and put the richfaces-api.jar and the richfaces-ui.jar into my EAR lib directory? Is so, this seems to controdict the instructions on the Seam 2.0 migration guide where it states:



        ajax4jsf.jar and richfaces.jar have been replaced by
      richfaces-api.jar (which should go in your ear lib/ directory) and
      richfaces-impl.jar and richfaces-ui.jar (both of which go in WEB-INF/lib).
        • 1. Re: Configure RichFaces for rich:tree
          brackxm

          If you do not want to change the classloading configuration you can put all the jar in the lib dir of your ear so they have the same classloader.

          • 2. Re: Configure RichFaces for rich:tree

            I tried your suggestion but get the following:


            Caused by: java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester


            This came when I removed the richface jars from the War/web-inf directory into the ear lib.

            • 3. Re: Configure RichFaces for rich:tree
              blabno

              Put


              Class-Path: lib/



              in you war/META-INF/MANIFEST.MF and move libs into ear/lib. This works for me.
              If you want to keep libs directly in ear/ then try


              Class-Path: /



              but I haven't tried it.

              • 4. Re: Configure RichFaces for rich:tree

                Thanks for the suggestion. That did the trick. It is working fine now. I assume there are no side affects with moving all jars from the war lib directory to the ear lib directory.


                Thanks.

                • 5. Re: Configure RichFaces for rich:tree
                  enda

                  Are you moving all libs from *.war/WEB-INF/lib to ear/lib? or just richfaces libraries?


                  I have exploded war so I do not have META-INF there, I expect you mean to create one?


                  Thanks.


                  • 6. Re: Configure RichFaces for rich:tree
                    enda

                    Ok I got something stable.



                    1. richfaces + seam mail works

                    2. Not extra class load configuration necessary (no modification of java2ClassLoadingCompliance)

                    3. No extra meta-file necessary

                    4. RichFaces 3.2.1 seam 2.0.3.CR1




                    • in app.war/WEB-INF/lib are jboss-seam-*.jar (6 in total)

                    • in app.ear/lib is everything else. (commons*..,richfaces*..,drools..,antlr,janino,core,jboss-el,easy-jclaim,jbpm,jsf,mvel..)



                    seems work..

                    • 7. Re: Configure RichFaces for rich:tree
                      mozyxl

                      The following change to the build.xml did the trick for me:


                      <copy todir="${war.dir}/WEB-INF/lib">
                                              <fileset dir="${lib.dir}">
                                                   <include name="jboss-seam-*.jar"/>
                                                   <!--
                                                      <includesfile name="deployed-jars-war.list" />
                                                      <exclude name="jboss-seam-gen.jar" />
                                                     -->
                                              </fileset>
                                      </copy>
                      
                      
                        <copy todir="${ear.dir}/lib">
                                              <fileset dir="${lib.dir}">
                                                      <includesfile name="deployed-jars-ear.list" />
                                                   <includesfile name="deployed-jars-war.list"/>
                                                   <exclude name="jboss-seam-*.jar"/>
                                                   <exclude name="jboss-seam-gen.jar" />
                                              </fileset>
                                      </copy>
                      
                      



                      • 8. Re: Configure RichFaces for rich:tree
                        blabno

                        I've moved richfaces-ui/api/iml to ear/lib, but I was getting strange NullPointerException in NamespaceHanlder. I had to move jsf-facelets to ear/lib also.