1 2 Previous Next 20 Replies Latest reply on Feb 4, 2006 10:49 PM by gavin.king

    Seam on Tomcat

    gavin.king

      For Tomcat fans, I finally managed to get around to making the examples work smoothly on Tomcat.

      This is work only available in current CVS.

      Both the booking and noejb examples can be deployed to Tomcat, and full instructions may be found in the readme files in the respective directories. Read the instructions first!

        • 1. Re: Seam on Tomcat
          marceloverdijk

          Good work!

          Hope the official second beta will be released soon.

          • 2. Re: Seam on Tomcat
            werpu

            Woho... thanks Gavin, this is awesome.

            • 3. Re: Seam on Tomcat

              Worked great, though I had to override src.test.dir in the tomcat build file. Cheers for sorting this out

              • 4. Re: Seam on Tomcat
                gavin.king

                Why did you need to override src.test.dir?

                You were trying to run the unit tests from build.tomcat.xml ??

                • 5. Re: Seam on Tomcat

                  I got a:

                  "jboss-seam/examples/booking/src/test" doesn't exist"

                  error when running the default deploy target in build.tomcat.xml

                  This was due to compile target being sucked in from ../../build.xml, with ${src.test.dir} declared as a source path for the javac task, and "src/test" being the default value for that variable. The booking example directory I built from has it's source directly under the src directory however.

                  I hacked in an override by quickly thieving it from v1.23 of the regular jboss build.xml in the same booking example, just to get up a Tomcat deploy up and running asap. Wasn't trying to unit test - was just a bit short of time when I gave that tomcat build a try.

                  Looking at it now, I see the bpm example in cvs has a src/main and src/test style directory structure (like seam itself), so maybe the booking example needs the same subdir setup, even if only an empty test dir for now. Just a thought, as I'm not sure how your team envisage the included build.xml and relative path approach.

                  • 6. Re: Seam on Tomcat
                    matthew.edwards

                    I recieved those errors also. I checked all the example build files and got the results as listed below. The following is my story of checking out seam and building it.

                    Using Eclipse, I checked out the jboss-seam-head.

                    To stop Eclipse from complaining I had to change the build path from antlr-2.7.5H3.jar to antlr-2.7.6rc1.jar.

                    Then I set the build.property variables for Tomcat and JBoss.

                    Next, I built Seam without any problem.

                    Then I navigated to the examples section and tried using the build files to compile each one.

                    The following are my results:

                    examples/registration/build.xml --> worked

                    examples/registration/portlet/build.xml --> did not work; following error:

                    BUILD FAILED
                    C:\J2EE\project\jboss-seam-head\build.xml:140: srcdir "C:\J2EE\project\jboss-seam-head\examples\portlet\src\test" does not exist!
                    


                    examples/noejb/build.xml --> worked

                    examples/noejb/build.tomcat.xml --> did not work; following error:
                    BUILD FAILED
                    C:\J2EE\project\jboss-seam-head\examples\noejb\build.tomcat.xml:56: taskdef class org.apache.catalina.ant.DeployTask cannot be found


                    examples/dvdstore/build.xml --> did not work; following error:

                    C:\J2EE\project\jboss-seam-head\build.xml:140: srcdir "C:\J2EE\project\jboss-seam-head\examples\dvdstore\src\test" does not exist!


                    examples/crud/build.xml --> did not work; following error:

                    C:\J2EE\project\jboss-seam-head\build.xml:140: srcdir "C:\J2EE\project\jboss-seam-head\examples\crud\src\test" does not exist!


                    examples/bpm/build.xml --> worked

                    examples/booking/build.xml --> worked

                    examples/booking/build.tomcat.xml --> did not work; following error:
                    C:\J2EE\project\jboss-seam-head\examples\booking\build.tomcat.xml:56: taskdef class org.apache.catalina.ant.DeployTask cannot be found


                    examples/booking/build.alter.xml --> did not work; following error:
                    C:\J2EE\project\jboss-seam-head\build.xml:140: srcdir "C:\J2EE\project\jboss-seam-head\examples\booking\src\test" does not exist!


                    To fix the errors, I just opened up the build file and removed whatever was being called that caused it to fail. I think that may be bad.

                    • 7. Re: Seam on Tomcat
                      gavin.king

                      1. I will fix the problem with the error about a missing directory (I actually broke that after I sent the original post).
                      2. You need to put catalina-ant.jar in your ant lib directory.

                      • 8. Re: Seam on Tomcat
                        werpu

                        just tried it works great, but the startup times are significantly higher than in the noejeb example.
                        While I get 20 seconds in noejb I am between 60 and 70 seconds in the embedded ejb under Tomcat 5.5.12

                        • 9. Re: Seam on Tomcat
                          gavin.king

                          Hot deployment is always going to be faster and more reliable in JBoss. This is just a limitation of using Tomcat for stuff...

                          • 10. Re: Seam on Tomcat
                            werpu

                            the problem is less hot deployment it is more that you have to restart the server often during debugging sessions (thanks to the hotswap which does not work too well), that is one of the main problems many ejb servers have, that the startup times are problematic during the average development cycle.

                            This is a non issue on a production system which should not go down anyway. One of the reasons many people prefer plain servlet runners over full blown ejb servers, the turnaround times are simply much faster.

                            This is an issue which has to be worked on, in the non EJB and EJB space, unfortunately.

                            • 11. Re: Seam on Tomcat
                              gavin.king

                              Well, hot redeploy is working quite well for me running JBoss inside Eclipse. It doesn't work *every* time, and we know there are still some hot redeplyment related bugs in our EJB3 container (mostly related to stateful beans), but it works pretty well, and certainly better than on tomcat. Once we get the bugs ironed out, this will be beautiful.

                              AFAIK, in the case of JBoss, if hot redeployment fails, that means there is a bug in JBoss (that will be fixed).

                              I realize that *other* J2EE servers are a pain to debug (I used WebSphere for years), but this is not really the case with JBoss, IMO.

                              • 12. Re: Seam on Tomcat
                                gavin.king

                                P.S. My point is that if hot deploy is working correctly, then you should never *need* to restart the server while debugging (or any other time).

                                • 13. Re: Seam on Tomcat
                                  werpu

                                  Thanks for the clarification, Gavin,
                                  guess it is more a problem of the servlet runner plugins,
                                  (myeclipse in my case) trying to enforce a complete server restart instead of doing a redeploy during extensive hotswapping.

                                  I really appreciate the extensiveness of your answers, I know it is hard between all the work you do.
                                  I hope you still can find time to sleep ;-)

                                  • 14. Re: Seam on Tomcat
                                    gavin.king

                                    The bug in the build scripts is now fixed in CVS.

                                    Now I'm going to sleep ;)

                                    1 2 Previous Next