The Source for Java Technology Collaboration
User: Password:



Roger Kitain

Roger Kitain's Blog

Seam 1.1.0.GA On GlassFish

Posted by rogerk on January 04, 2007 at 10:12 AM | Comments (2)

To get prior releases of Seam running on GlassFish, you had to patch some Seam application modules. With this release, there is no patchwork necessary - the folks at JBoss (RedHat) have done a great job of streamlining the process. In fact, after you download and unpack the Seam 1.1.0.GA release from here, you will see a GlassFish sample application (which is essentially the booking application) under the "jboss-seam-1.1.0.GA\examples\glassfish" directory. In this entry, we will outline the steps to get this release of Seam running on GlassFish with Java Persistence.

Prerequisites:
  1. A working build environment with ant, at least JDK 5, and GlassFish. I've run this version of Seam successfully on the GlassFish v1 FCS (v1_ur1-p01-b02) and GlassFish v2 (Build 30) builds.
Seam Setup:
  1. Download and install the Seam 1.1.0GA release from here.  You should see a jboss-seam-1.1.0.GA directory.
  2. Go to the jboss-seam-1.1.0.GA/examples/glassfish directory.
  3. Build the sample application using the "toplink" build target:
    • ant clean; ant toplink
    The "toplink" target builds the EAR file using toplink as the JPA provider.
Deploy the application:
  1. Start up GlassFish:   <glassfish install dir>/bin/asadmin start-domain domain1
  2. Start the database:  <glassfish install dir>/bin/asadmin start-database
  3. Deploy jboss-seam-1.1.0.GA/examples/glassfish/build/jboss-seam-glassfish.ear
    • Note that deploying the application will create the necessary application database tables, and undeploying the application will remove the application database tables.
Load the database:
  1. Get the sql script that will be used to load the database from here and unpack it to some directory. You should see the script: import.sql
  2. Go to the directory that contains the import.sql script.
  3. Set your CLASSPATH to include:
    • <glassfish install dir>/javadb/lib/derbyclient.jar
    • <glassfish install dir>/javadb/lib/derbytools.jar
    • <glassfish install dir>/javadb/lib/derby.jar
  4. Get into the "ij" utility: java org.apache.derby.tools.ij
  5. At the "ij>" prompt:
    • ij> DRIVER 'org.apache.derby.jdbc.ClientDriver';
    • ij> CONNECT 'jdbc:derby://localhost:1527/sun-appserv-samples';
    • ij> run 'import.sql';
  • Now the Seam application tables should be loaded.
Run the application:
  • visit localhost:8080/jboss-seam-glassfish

Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • This is an excellent write-up. I've tested and verified functionality with Seam 1.2.1 GA and Glassfish v2 - build b41b-beta2 also.

    Thanks

    Posted by: javajuneau001 on June 09, 2007 at 09:08 PM

  • has anyone tested seam 2 with glassfish 2 ?

    Posted by: caroljmcdonald on January 22, 2008 at 08:46 AM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds