Version 14

    A movie to show how to configure Eclipse is available at http://www.jboss.com/products/seam/EclipseCVS.html

     

    Note: If you are using Eclipse 3.2 take a look at this wiki page: How to launch the JBoss As 4.0.x in Eclipse 3.2

     

    Here's how to get JBoss, Eclipse, Seam and the booking example to work together.

     

    1. Make sure that you have JDK1.5 installed.

    2. Install eclipse into ..\eclipse  (i'll call it \eclipse from now on)

    3. Use eclipse's auto update to install the most recent development version of JBoss Eclipse IDE (this wiki has been tested with 1.5M3)

      1. From Eclipse's main menu, choose Help->Software Updates->Find And Install...

      2. Use the URL http://download.jboss.org/jbosside/updates/stable

      3. As of the writing of this Wiki 1.5M3 seems to have best compatibility with JBoss Seam, and JBossAS.

    4. Download JBoss App Server 4.0.3 here: http://jboss.sourceforge.net/jnlp/jboss-4.0.3-installer.jnlp

    5. Choose the ejb3 configuration when installing JBoss AS we will call the directory where you installed JBoss AS \jbossas

    6. Download Seam 1.0 Beta from http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=163777

    7. Unzip/Install Seam into a directory (call it \seam)

    8. Configure Eclipse to use JDK5.0

      1. From eclipse's main menu, choose Windows->Preferences->Java->Compiler

      2. Set the Compiler Compliance level to 5.0.

      3. With this same dialog still open, go to the Installed JRE section and add an entry for the JDK5.0 and make sure you mark the check box to make it the default jre/jdk

    9. Start eclipse

    10. Add a new Project called "Seam".  Choose the JBoos-IDE/J2EE Projects/J2EE 1.4 Project type from the Wizard

    11. Add the seam libraries to the buildpath (the JARs in \seam\lib)

      1. Select the Seam project, right mouse click->Build Path...->Configure Build Path...

      2. Select the Libraries tab and press the Add External JARs button.  Now select the JARs and press ok.

    12. Add the the Seam class files

      1. Select the Seam project->right mouse button->Import...

      2. On the next dialog, choose Archive file and from the next file dialog choose the archive file in the \seam directory (should be jboss-seam.jar) and press the finish button.

    13. Import the source for the Seam class files

      1. Select the Seam project->right mouse button->Import...

      2. On the next dialog, choose File system and press Next.  In the next dialog choose the the \seam\src directory.

      3. In the Into folder section, enter Seam/src.

      4. Activate the checkbox next to the src folder to select all of the files.

      5. Press the Finish button.

      6. Now select the folder named main and Right mouse button->Build Path...->Use as Source Folder

    14. Import the source for the booking example

      1. Select the Seam project->right mouse button->Import...

      2. On the next dialog, choose File system and press Next.

      3. In the next dialog choose the the \seam\examples\booking\src directory.

      4. In the Into folder section, enter Seam/src.

      5. Activate the checkbox next to the src folder to select all of the files.

      6. Press the Finish button.

      7. Select the folder named src and Right mouse button->Build Path...->Use as Source Folder

      8. Now all the source files should be imported and show no errors.

    15. Reorder build path

      1. Choose the the Seam project->right mouse button->Build Path...->Order and Export tab.

      2. Move the Seam source folders to the top using the up/down buttons.

    16. Set up the Debugger.

      1. Choose Debug... (from the debugger menu).

      2. Select the JBoss 4.0.x configuration and press the New button.

      3. On the Home tab, choose "default" as the Server configuration.

      4. Select the \jbossas folder as the Home directory.  Give the configuration a name - how about "Seam" and press Apply and then Close.

    17. Set the build properties of the seam installation

      1. go to the \seam\build.properties file and set jboss.home to the \jbossas folder

    18. Build the booking example

      1. Go to the \seam\examples\booking directory an type "ant deploy"

      2. You'll need to make sure that ant is in your path and you may need to have the JAVA_HOME variable set as well.  (Of course you can probably use the ant building in Eclipse to do this also...)

    (you can look at the example docs for more details).

    1. Restart Eclipse.  Shouldn't need to do this - but seems needed after changing the compile option in 8.

    Now you can debug away to your hearts content.  As a test, put a breakpoint in the booking example org.jboss.seam.example.booking.LoginAction.java (like aroun the "invalid login" message).  Start JBoss by choosing the Seam debug option (the one you created).  This will start the server.  After it's started, you can point the browser at the server - http://localhost:8080/seam-booking/  should

    do it.  This will give you the first page.  Type in something random into the login window and press "Account Login" - assuming you've put the breakpoint in the invalid login line, this will hit the breakpoint.