11 Replies Latest reply on Nov 13, 2007 5:15 PM by svadu

    seam-gen is not a solution worth trying for existing EJB3 pr

    mortena

      Hi Seam folks

      I've tried getting a proper start using seam by using seam-gen. The basis of the project is a running EJB3 application with a JSP based web-interface.

      Based on a number of searches on the web I concluded that seam-gen should be able to generate the CRUD based WEB-UI in seconds based on the existing EJB3 application.

      It is not! And I recommend none to use that tool!

      seam-gen reverse engineers directly from the database not the EJB3's already created and it does it in a rather dumb manner! ?

      All the information regarding the relationships (OneToOne, ManyToOne and ManyToMany) between the entities are totally lost when the view is generated from database instead of directly from the EJB's.

      The reason for this is probably that it was possible to use hibernate Tools as a basis for seam-gen and that the developers needed something up and running fast...

      Why is there not a tool in the seam-gen pack, that makes it possible to generate a CRUD view with proper support for dates, relationsships etc. directly from EJB3 entities?

      This would make it possible to create the entities, set the relationships between them and have a seam-application up and running based on that in no time.

      Instead we're stuck with a tool that does some of the basic stuff in a seam-application like inserting strings into entities using a textinput but not the stuff like creating a drop-down with objects to select the "One" side in a ManyToOne relationsship.

      Please comment on the following:

      - How can I go from an existing EJB3 application with a JSP based ui to a seam application?
      - How can I support refactoring in such an application?
      - How can I support an iterative implementation in such an environment?
      - What are the plans with seam-gen?

        • 1. Re: seam-gen is not a solution worth trying for existing EJB
          maxandersen

          calm down please ;)

          1) If you want specific features in the generated code then please contribute it - its just a matter of adding/fixing the templates.

          2) seam-gen as it is in the ant scripts is just done via reverse engineering but hibenate tools supports using existing entities just fine and there are even a jira for it to be applied - someone just need to pick that up and get it applied properly. It's described at http://jira.jboss.com/jira/browse/JBSEAM-843 and even with a patch you can easily try out if you want.

          3) Just to prove it works - then In JBoss Tools you have two options when you choose seam generate entities you have the option of selecting Reverse Engineer from database OR Use exiting entities.

          • 2. Re: seam-gen is not a solution worth trying for existing EJB
            mortena

            Hi Max

            Sorry about the tone. I wasn't meant to be rude. I've just been fighting with these thing for a while now without much luck.

            My frustrations is actually more a result of a lack of help and documentation regarding these matters. (Like why do I have to use something found in a jira containing a few attachments but no intro).

            It seams like the sources of information is spread into too many places:
            - This forum
            - Michael Yuan's blog
            - Hibernate Tools' website
            - in.relation.to
            - various articles and blogs online
            - Some slideshows presented at various conferences etc.

            Why not set up a wiki / confluence or something similar where users can contribute to a gathered documentation.

            1) If you want specific features in the generated code then please contribute it - its just a matter of adding/fixing the templates.

            I would gladly do that but how do I start when I can't figure out what the status of the various projects / subprojects are?

            2) seam-gen as it is in the ant scripts is just done via reverse engineering but hibenate tools supports using existing entities just fine and there are even a jira for it to be applied - someone just need to pick that up and get it applied properly. It's described at http://jira.jboss.com/jira/browse/JBSEAM-843 and even with a patch you can easily try out if you want.

            I've seen the Jira, but it is not very well documented or described. I've tried downloading the build-jpa.xml and adding a generate-ui target in the build.xml file, but it gives me some errors like: "view/extension not found." How to use the .patch files I don't know.

            3) Just to prove it works - then In JBoss Tools you have two options when you choose seam generate entities you have the option of selecting Reverse Engineer from database OR Use exiting entities.

            That is great. I'll give it another shot. Starting from JBoss Tools I think...

            Please let me know if there's anything I can contribute with making seam the success it should be.

            • 3. Re: seam-gen is not a solution worth trying for existing EJB
              mortena

              Installing JBoss IDE causing problems:

              I get the following error:

              org.jboss.ide.eclipse.ejb3.feature (1.0.2.GA) requires plug-in "org.eclipse.jdt.source".

              How do I proceed from that?

              My starting point is MyEclipse.

              Thanks

              Morten

              • 4. Re: seam-gen is not a solution worth trying for existing EJB
                maxandersen

                JBoss IDE does not have these things integrated - you should be looking at JBoss Tools.

                And I just checked - there are zero references to org.eclipse.jdt.sourceorg.eclipse.jdt.source in JBoss Tools (don't know about older JBoss IDE)

                p.s. I can't guarantee anything on top of MyEclipse; only Eclipse WTP

                p.p.s. husk at stemme - jeg kan desvaerre ikke ;)

                /max

                • 5. Re: seam-gen is not a solution worth trying for existing EJB

                  @ Morten:
                  MyEclipse likes to ship own/different version of WTP, I also had problems there some time ago when I was using MyEclipse. Then I just started using Exadel plugin when it became decent enough. So don't be surprised if you have that kind of issues. Try it on Eclipse Europa first and see if the problem comes back. Or raise an issue at MyEclipse to include the latest version of WTP.

                  @ Max:
                  do I have the right impression that there is lack of committers for Seam? Some issues hang in Jira for half a year or even longer (even though there are patches which merely need to be checked and merged). With Michael Yuan left Red Hat is he still a committer or is there a replacement?

                  • 6. Re: seam-gen is not a solution worth trying for existing EJB
                    maxandersen

                    @Svadu:
                    Michael Yuan is still a committer and we got a good set of committers, but we can always use an helping hand - especially around the tooling (both seamgen and hibernatetools ;)

                    I have spent most of my time focusing on JBoss Tools/RHDS so I haven't been able to pick up the generate entities functionallity in seam-gen yet....

                    • 7. Re: seam-gen is not a solution worth trying for existing EJB

                      Siarhei,

                      I am still working with Seam and JBoss Tools everyday. :) But yes, Seam can certainly use more help -- especially in areas related to non-JBoss application servers. Please let us know if you want to contribute! :)

                      cheers
                      Michael

                      • 8. Re: seam-gen is not a solution worth trying for existing EJB

                        Well since you mentioned other servers, this is for the starters:

                        http://jira.jboss.com/jira/browse/JBSEAM-1022

                        I've submitted it in March and it's getting postponed with every release.
                        I don't like to hijack topics so if there is further discussion about that we can move it to another topic.

                        • 9. Re: seam-gen is not a solution worth trying for existing EJB

                          Siarhei,

                          Sorry, I have not had a chance to install Resin and try out your fix. ;) If we do commit to this to the code, we will need to maintain it for every Seam release. Can you help us with this?

                          Also, since Seam 2.0.0 has just been released, can I ask you to update the issue with the latest examples? It will be great if you can send us a build-resin.xml for JPA and Hibernate2 examples. Thanks!

                          cheers
                          Michael

                          • 10. Re: seam-gen is not a solution worth trying for existing EJB

                            I will certainly try (for both questions)

                            • 11. Re: seam-gen is not a solution worth trying for existing EJB

                               

                              "juntao" wrote:
                              Siarhei,

                              Sorry, I have not had a chance to install Resin and try out your fix. ;) If we do commit to this to the code, we will need to maintain it for every Seam release. Can you help us with this?

                              Also, since Seam 2.0.0 has just been released, can I ask you to update the issue with the latest examples? It will be great if you can send us a build-resin.xml for JPA and Hibernate2 examples. Thanks!

                              cheers
                              Michael


                              Michael, I've updated the issue with the latest examples and also made the Resin team aware of problems in their latest server version.