11 Replies Latest reply on Jun 7, 2007 9:57 AM by maku01

    Seam + Maven + Richfaces + softeu

    maku01

      Hi

      I tried out to generate a seam project with the softeu plugin
      (I've strong needs to use maven for the build because of maven is the standard in our company).

      The first steps were really successfully.

      But I noticed a problem to integrate richfaces lib. The richfaces tags are not resolved when I run the app.


      Do you have an advice to get this thing running?

      When I tried to integrate richfaces in the pom as dependency (from the jboss maven repo I tried version 3.0.0 and 3.0.1), the app is not able to start because of configurations problems (I think ajax4jsf is defined twice)

      TIA

      Regards,
      Martin

      BTW, I know there is very good support for ant. But a support for maven would really beneficial. When I think I've to integrate an existing backend project developed on top of spring I could imagine that the integration will be a nightmare.

        • 1. Re: Seam + Maven + Richfaces + softeu
          awhitford

          I would like to reiterate the value of Maven support.

          I liken Maven to my TiVo. It is one of those inventions that you don't really need, but when you start using it, you realize the benefits.

          The main issue with using Maven is that the open-source dependencies are driven by a community. If everyone used/supported Maven, my build and dependency management would be much easier. The main stumbling block with Maven is typically when you try integrating projects that don't support Maven. Simple jars (like JDBC drivers) are usually not a problem, but frameworks with lots of dependencies (and dependencies have dependencies, etc.) can be awkward.

          The Maven user community has grown significantly over the past year, and it sounds like it will overtake Ant.

          The JBoss Maven2 repository (http://repository.jboss.com/maven2/) is very helpful. Thanks!

          • 2. Re: Seam + Maven + Richfaces + softeu
            lightguard

            We're working on doing the same thing here at work. We have Ajax4JSF and RichFaces in the war file (you could use the ear) and they seem to be working just fine. Double check to see if you have it loaded twice (like you thought might be happening) in the war / ear or on JBoss AS itself.

            I also would like to see official support for maven. Both of the referenced seam archetypes seem defunct now (the lunarlogic one has source available if someone wants to take it over, I don't have time to maintain it). The softeu stuff looks really good, but I also think this is defunct. Maybe a merge of the two would be good. I know there have been talks (there's an eight page thread on the forum about this) of someone maintaining a repo for seam, but it looks like it didn't get as far as we were all hoping (there is a list of dependencies for seam 1.0.1, but nothing since).

            I think Gavin's take (correct me if I'm wrong here) is for someone in the community to head it up, then they can reference that. An "official" JBoss support for maven would be very nice, but not as likely.

            • 3. Re: Seam + Maven + Richfaces + softeu
              fabricio.lemos

              JBSEAM-983 http://jira.jboss.org/jira/browse/JBSEAM-983 now is the second most voted issue on JIRA.

              • 4. Re: Seam + Maven + Richfaces + softeu
                maku01

                 

                "Lightguard" wrote:
                We're working on doing the same thing here at work. We have Ajax4JSF and RichFaces in the war file (you could use the ear) and they seem to be working just fine. Double check to see if you have it loaded twice (like you thought might be happening) in the war / ear or on JBoss AS itself.


                I used the softeu plugin to generate the base seam infrastructure. The result of the generation is a maven project where the pom.xml references selfmade dependencies of the softeu repository. So it's not easy to solve the problem for me. (I tried to add dependency to richfaces as mentioned in my first post but this leads to errors)

                • 5. Re: Seam + Maven + Richfaces + softeu
                  lightguard

                  Is it the seam references that are giving you a hard time or the richfaces stuff?

                  • 6. Re: Seam + Maven + Richfaces + softeu
                    maku01

                     

                    "Lightguard" wrote:
                    Is it the seam references that are giving you a hard time or the richfaces stuff?

                    The maven plugin from softeu define a dependency like this:

                    <dependency>
                    <groupId>jboss.seam.profiles</groupId>
                    <artifactId>seam-ajax4jsf</artifactId>
                    <version>${seam.version}</version>
                    <scope>compile</scope>
                    </dependency>


                    But the webapp is not able to resolve the richfaces tags when I run the app (the html of the browser contains the <rich:..> tags)

                    When I comment the dependency above out and use something like this instead:

                    <dependency>
                     <groupId>org.richfaces</groupId>
                     <artifactId>richfaces</artifactId>
                     <version>3.0.0</version>
                    <dependency>


                    I get an exception like this:

                    05.06.2007 18:13:34 org.jboss.seam.jsf.AbstractSeamPhaseListener WARNUNG: There should only be one Seam phase listener per application
                    java.lang.ClassNotFoundException: [Ljava.lang.String;
                    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

                    • 7. Re: Seam + Maven + Richfaces + softeu
                      -arthur-

                       

                      "maku01" wrote:
                      "Lightguard" wrote:
                      Is it the seam references that are giving you a hard time or the richfaces stuff?

                      The maven plugin from softeu define a dependency like this:

                      <dependency>
                      <groupId>jboss.seam.profiles</groupId>
                      <artifactId>seam-ajax4jsf</artifactId>
                      <version>${seam.version}</version>
                      <scope>compile</scope>
                      </dependency>


                      But the webapp is not able to resolve the richfaces tags when I run the app (the html of the browser contains the <rich:..> tags)

                      When I comment the dependency above out and use something like this instead:

                      <dependency>
                       <groupId>org.richfaces</groupId>
                       <artifactId>richfaces</artifactId>
                       <version>3.0.0</version>
                      <dependency>


                      I get an exception like this:

                      05.06.2007 18:13:34 org.jboss.seam.jsf.AbstractSeamPhaseListener WARNUNG: There should only be one Seam phase listener per application
                      java.lang.ClassNotFoundException: [Ljava.lang.String;
                      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)


                      Go to your maven repo and open yourRepoPath/jboss/seam/profiles/seam-ajax4jsf and open the pom.xml

                      Here you find transitive artifacts.
                      Comment out the ajax4jsf artifact.

                      Now go to your projects pom and add the following:
                      <dependency>
                       <groupId>org.richfaces</groupId>
                       <artifactId>richfaces</artifactId>
                       <version>your version</version>
                       <exclusions>
                       <exclusion>
                       <groupId>org.ajax4jsf</groupId>
                       <artifactId>ajax4jsf</artifactId>
                       </exclusion>
                       </exclusions>
                      <dependency>
                      
                      <dependency>
                       <groupId>org.ajax4jsf</groupId>
                       <artifactId>ajax4jsf</artifactId>
                       <version>your version</version>
                      </dependency>
                      


                      assuming you have installed ajax4jsf in your repository.

                      • 8. Re: Seam + Maven + Richfaces + softeu
                        maku01

                         

                        "-Arthur-" wrote:

                        Go to your maven repo and open yourRepoPath/jboss/seam/profiles/seam-ajax4jsf and open the pom.xml

                        Here you find transitive artifacts.
                        Comment out the ajax4jsf artifact.

                        Now go to your projects pom and add the following:
                        <dependency>
                         <groupId>org.richfaces</groupId>
                         <artifactId>richfaces</artifactId>
                         <version>your version</version>
                         <exclusions>
                         <exclusion>
                         <groupId>org.ajax4jsf</groupId>
                         <artifactId>ajax4jsf</artifactId>
                         </exclusion>
                         </exclusions>
                        <dependency>
                        
                        <dependency>
                         <groupId>org.ajax4jsf</groupId>
                         <artifactId>ajax4jsf</artifactId>
                         <version>your version</version>
                        </dependency>
                        


                        assuming you have installed ajax4jsf in your repository.


                        When I do it in this way I get the same error at startup.
                        When I use a richfaces dependency with no transitive artifacts I get an exception on first access to a page
                        javax.faces.FacesException: Resources framework is not initialised, check web.xml for Filter configuration
                         at org.ajax4jsf.framework.resource.ResourceBuilderImpl.getWebXml(ResourceBuilderImpl.java:107)
                         at org.ajax4jsf.framework.resource.ResourceBuilderImpl.getUri(ResourceBuilderImpl.java:309)
                         at org.ajax4jsf.framework.resource.InternetResourceBase.getUri(InternetResourceBase.java:211)
                         at org.ajax4jsf.framework.resource.BaseResourceRenderer.encodeBegin(BaseResourceRenderer.java:62)
                         at org.ajax4jsf.framework.resource.OneTimeRenderer.encodeBegin(OneTimeRenderer.java:48)
                        


                        • 9. Re: Seam + Maven + Richfaces + softeu
                          maku01

                           

                          "-Arthur-" wrote:

                          Go to your maven repo and open yourRepoPath/jboss/seam/profiles/seam-ajax4jsf and open the pom.xml

                          Here you find transitive artifacts.
                          Comment out the ajax4jsf artifact.

                          Now go to your projects pom and add the following:
                          <dependency>
                           <groupId>org.richfaces</groupId>
                           <artifactId>richfaces</artifactId>
                           <version>your version</version>
                           <exclusions>
                           <exclusion>
                           <groupId>org.ajax4jsf</groupId>
                           <artifactId>ajax4jsf</artifactId>
                           </exclusion>
                           </exclusions>
                          <dependency>
                          
                          <dependency>
                           <groupId>org.ajax4jsf</groupId>
                           <artifactId>ajax4jsf</artifactId>
                           <version>your version</version>
                          </dependency>
                          


                          assuming you have installed ajax4jsf in your repository.


                          When I define richfaces 3.0.1 and ajax4jsf 1.1.1 as dependencies (with no transitive dependencies) it WORKS!!!!!!!!

                          • 10. Re: Seam + Maven + Richfaces + softeu
                            -arthur-

                            Great :)

                            So, post your complete solution so others can benefit from it.

                            • 11. Re: Seam + Maven + Richfaces + softeu
                              maku01

                              Here is the solution for me working with the softeu maven tool:

                              e.g.

                              1) Generate a maven based project with:

                              mvn archetype:create -DarchetypeArtifactId=softeu-archetype-seam -DremoteRepositories=http://maven.softeu.cz/ -DgroupId=at.test -DartifactId=testapp
                              

                              This is equivalent to the seam generator (seam new-project)

                              After the generation process you are able to run the application e.g. with "mvn jetty:run".
                              When I pointed the browser to the app it seams first that the app runs fine.
                              But in my case I had the problem that richfaces tags are not resolved.

                              (The browser receives html code like <rich:panel> </rich:panel> and so on)

                              2)
                              The solution for the problem (at least for me) was to eliminate the following dependency from the pom.xml


                              <dependency>
                              
                               <groupId>jboss.seam.profiles</groupId>
                              
                               <artifactId>seam-ajax4jsf</artifactId>
                              
                               <version>${seam.version}</version>
                              
                               <scope>compile</scope>
                              
                              </dependency>
                              





                              and to add new dependencies (only existing in my local repository) like this:



                              <!--- START ajax4jsf locally installed -->
                              
                               <dependency>
                              
                               <groupId>richfaces</groupId>
                              
                               <artifactId>richfaces</artifactId>
                              
                               <version>3.0.1</version>
                              
                               </dependency>
                              
                              
                              
                               <dependency>
                              
                               <groupId>ajax4jsf</groupId>
                              
                               <artifactId>ajax4jsf</artifactId>
                              
                               <version>1.1.1</version>
                              
                               </dependency>
                              
                              
                              
                               <dependency>
                              
                               <groupId>opensymphony</groupId>
                              
                               <artifactId>oscache</artifactId>
                              
                               <version>2.3.2</version>
                              
                               </dependency>
                              
                              <!--- END ajax4jsf locally installed -->
                              



                              (for me it worked only with the version richfaces 3.0.1 and ajax4jsf 1.1.1)

                              Hope this helps for anybody who has the same problem.

                              3)
                              Although, I'm NOT really happy with this solution. It is my strong believe that a maven based tool supported from JBoss would be a real huge benefit for the developer community.
                              From my point of view maven is a really good tool.

                              Especially when you work in a larger enterprise and you have many projects and dependencies between them I can not easy handle the dependencies with a tool like ant.