8 Replies Latest reply on Nov 13, 2006 3:57 PM by gavin.king

    Simple but complete Maven or ant example project needed

    andygrav

      I want to recount my experiences with Seam, in the hope that the developers/documenters can make it less complex to write a seam application.

      Im going to concentrate on the negative points as they are the ones that I think need fixing.

      After reading the documentation I saw that Seam solves a lot of the problems that I have come across in web development.

      I installed jboss and downloaded the seam cvs and deployed the example programs.
      Great! I understood the simple examples and they worked, fantastic.

      Then I had a look at DVD store and HotelBooking but they are kind of Phd material, I installed them and they worked but as for understanding them hmmm.

      Then I tried to create my own project, the nightmare began ... to figure out what files you need in what places is complex, (Im not a J2EE developer but have used struts, spring, hibernate (ejb3), jbpm and drools separately)

      I wanted to use tomahawk with the dataTable and inputDate component, too complicated!,
      even now I couldnt tell you how I managed to get it configured.
      Then I tried getting the file upload configured, more classloading issues.

      I think there is a need for some intermediate examples.

      Better still a kind of template application that has all of the configuration files in place
      -sticks to the best practices of classloading (hierarchical????)
      -uses JAAS for the Login with tomcat security
      -uses Security interceptors to make sure that the user is authorised
      -uses tomahawk
      -uses ADF Faces (dont know if tomahawk and adf faces can be used in the same project)
      -fileupload (tomahawk)
      -facelets
      -tag files
      -datascrollers
      -jbpm
      -drools
      -portlets
      -jasper reports
      -mail

      Seam integrates a lot of cool things but the configuration is a nightmare, I know everything
      is complex at first but it could be a lot smoother to learn with a base application.

      I think it would be good to have all the functionality in one application, but split the application
      into easy to understand sections, or another idea is for all the examples stemming from a common layout and comment out the bits that arent needed for a particular example.

      I would like to write a maven archetype for Seam but at the moment am still struggling
      to get to grips with a fairly simple application.

      I know that a lot of the problems that I have had are due to classloading that is a general jboss problem and nothing to do with the seam developers.

      Another thing that would be good is a fairly high level block diagram of seam,
      what it does in what order, how Injection and Outjection work, in what order the methods get called.
      (I just got hit by the seam Logger not getting injected before a PostConstruct method was
      called)

      When I finally get to understand it I think Ill write a book called "Seams Easy"

      I can see that its a great product, but wow what a steep learning curve.

      If any seam expert is interested I can send them my maven (hacked about) project to improve on it and then when it is ready for general use put it on the web.

      Thanks in advance.

      Andy Bailey
      www.hazlorealidad.com

        • 1. Re: Simple but complete Maven or ant example project needed
          jbmadair

          I have two projects that may help since I have actually approached it as a two-part issue:

          1. Maintanence and control of JBoss AS configurations, I used Ant for this, just easier, and no point to Maven as far as I can see.

          (BTW, I'm looking forward to getting a good look at JBoss AS 5, because I believe that some very simple things in the default installs could be improved to more quickly lead people to repeatable installation configurations that are low maint for development, continuous integration, QA and production environments, but I want to get a good look at the new system to see if some new ideas have already been incorporated.)

          2. Seam Application build control with Maven 2 while also supporting automatic compilation in Eclipse and in place JBoss deployment.

          Currently I have the following configured:

          - Seam
          - Facelets
          - Tomahawk
          - File upload
          - JSP for dynamic CSS/JS when needed (paths, etc)
          - JPDL
          - I'm sure there's plenty more that I'm not thinking of this moment.

          I am currently working to add:

          - JAAS
          - Request-level security filter
          - Considering adding ADF, also not sure how nicely they play together

          I'm not sure about best practices for classloading. I like most of the defaults, and have made good use of them. Lot of trial and error to come to the exact current config, but it seems to work out nicely (I'm relatively new to JBoss in general, my previous J2EE experience was all with the more obscure ATG Dynamo)

          I will put it here or Wiki in a day or two, unless someone beats me to it with a better config (it wouldn't be hard ;D)

          -- Marcus

          • 2. Re: Simple but complete Maven or ant example project needed
            andygrav

            Great,

            I was checking the wiki for the project but havent found it yet.

            Can you post the url here when you upload it.

            Andy Bailey
            www.hazlorealidad.com

            • 3. Re: Simple but complete Maven or ant example project needed

              If you check the "Tips" section of Wiki, the "Seam Projects in Eclipse" section has two links to wiki pages that might be of some help in setting up projects from scratch using Eclipse and Ant. They are admittedly not Maven and don't show all the other cool examples you mentioned.

              • 4. Re: Simple but complete Maven or ant example project needed
                andygrav

                Still no sign of the project on the Wiki,

                any chance of posting the URL here?

                Andy Bailey
                www.hazlorealidad.com

                • 5. Re: Simple but complete Maven or ant example project needed
                  psinger

                  You're in luck!

                  I happen to be creating a Seam application right now using Maven 2 and I have already made an archetype! I am working on getting it publicly available within the next few days.

                  Phillip Singer
                  http://www.lunarlogic.com[/url]

                  • 6. Re: Simple but complete Maven or ant example project needed
                    psinger

                    It's posted!

                    The URL for the repository is http://labs.lunarlogic.com/proximity/repository/. The group id is "com.lunarlogic.maven.archetypes" and the artifact id is "maven-archetype-jee-seam".

                    In order to use this without installing the artifact manually you need to add the following entry to ~/.m2/settings.xml

                    <settings>
                     ...
                     <profiles>
                     ...
                     <profile>
                     <id>lunarlogic-repository-profile</id>
                     <repositories>
                     <repository>
                     <id>lunarlogic</id>
                     <url>http://labs.lunarlogic.com/proximity/repository/lunarlogic</url>
                     </repository>
                     </repositories>
                     </profile>
                     ...
                     </profiles>
                     ...
                     <activeProfiles>
                     ...
                     <activeProfile>lunarlogic-repository-profile</activeProfile>
                     ...
                     </activeProfiles>
                     ...
                    </settings>
                    


                    Usage instructions have been posted at http://www.lunarlogic.com/blog/show/maven_archetype_for_jboss_seam.

                    Phillip Singer
                    http://www.lunarlogic.com

                    • 7. Re: Simple but complete Maven or ant example project needed
                      mzeijen

                      Nice that you published your archetype. Looks good. It would be really cool if some official maven2 support was added to this project and maybe other JBoss projects. When used correctly, Maven2 is so much powerfull and easier then Ant.

                      I also have something to contribute for those people that use the maven2 eclipse plugin: http://www.smies.com/blog/?p=26. Take a look at it for a more stable version then the one that is released now (0.0.9).

                      I am also working on some stuff to improve the experience with Eclipse, Maven2 and Seam. This includes hot-deployment of static files (jsf, jsp, etc.) to a JBoss server. I wanted to create a blog post on it some while back, but I am very busy at work right now so I don't have the time to work on it. Hopefully soon stuff will cool down at work .

                      • 8. Re: Simple but complete Maven or ant example project needed
                        gavin.king

                        Start a Wiki page for this stuff.