3 Replies Latest reply on Dec 16, 2008 1:20 PM by stefanotravelli

    Examples on Eclipse

    paolodesa

      Hi,
      i am a newbie with seam. i'm trying to follow the steps 'Running Seam examples with Apache Tomcat' on Eclipse (version ganymede)...but i got stuck...for example, i want to run the 'booking' demo.
      Which kind of project should I create to execute that demo? A 'dynamic web application'? I tried many different kinds of projects, adding them the folders 'resources', 'view', etc etc, contained in the example's folder...but it doesn't work.


      I have ant, jdk and everything installed and working...but i don't understand how to do the step: 'Run ant tomcat6 to build the application'...
      First: i don't see any executable file in my ant folder
      Second: what could i build, if i am not able to create the project on eclipse?
      :(

        • 1. Re: Examples on Eclipse
          stefanotravelli

          It seems that you are not used to ANT, in first place.


          I suggest you to take a look at http://ant.apache.org/manual/. Don't use the latest release (1.7.1): there is a known bug that will break your seam projects generation. Ant 1.7.0 is fine.


          In your ANT folder, find a 'bin' directory in which you have ant.sh (or ant.bat, if you are on Windows). This is the ant executable.


          So, when the manual says run ant tomcat6 to build the application, it means go in the sample folder (/examples/booking, for instance) and type:




          /path_to_ant/bin/ant.sh tomcat6



          where path_to_ant is the path in which you placed the ANT distribution.


          Good luck




          • 2. Re: Examples on Eclipse
            paolodesa

            Ok, i did it. the result of the execution of ant.bat is the creation of 3 new folders inside the folder of the example i'm using, 'booking'.
            One of these 3 folder is 'jboss-seam-booking.war', which is empty.
            Now the procedure says: Deploy 'dist-tomcat6/jboss-seam-jpa.war'.
            How do i do that? This is the last step which keeps me from finally execute the example :-P

            • 3. Re: Examples on Eclipse
              stefanotravelli

              I found that a step by step instructions is in examples/readme.txt




              How to Build and Deploy the Example on Tomcat
              ---------------------------------------------
              
              1. Download and install Tomcat 6
              
                 NOTE: Due to a bug, you must install Tomcat to a directory
                 path with no spaces. The example does not work in a default
                 install of Tomcat.
                 
              2. Install Embedded JBoss as described in the "Configuration" chapter of the
                 Seam reerence documentation. 
                 
              3. Make sure you have an up to date version of Seam: 
              
                 http://seamframework.org/Download
              
              4. Open the "build.properties" file at the root of the Seam distribution in
                 your editor and change tomcat.home to point to your Tomcat directory
              
              5. (Optional) Build Seam by running "ant" the Seam root directory
                 Only required if you are working from an SVN checkout.
              
              6. Build and deploy the example by running the following command from the Seam
                 "examples/${example.name}" directory:
                 
                 ant tomcat.deploy
                 
                 To undeploy the example, run:
              
                 ant tomcat.undeploy
              
                 To redeploy/restart the deployed application, run:
              
                 ant tomcat.deploy
              
              7. Start Tomcat
              
              8. Point your web browser to:
              
                 http://localhost:8080/jboss-seam-${example.name}
                 
                 Note that examples deployed to Tomcat use the context path prefix
                 jboss-seam- rather than seam- like with the JBoss AS deployment.
              
              



              About step 2 (Install Embedded JBoss) see the reference documentation at page 482 29.6.1 Installing Embedded JBoss


              If you issued some other commands before and you are not sure about the status of the project, use ant clean to restore.


              Unfortunately I don't use Tomcat so I won't able to help you on issues you may find later.


              Hope this helps