Setting up JBoss Seam in Ubuntu

This post has moved to my new blog

This post describes the steps I took to set up JBoss AS 5.1.0 and Seam 2.2.0 in Ubuntu 9.04 on my local machine.  This post assumes Ubuntu 9.04 is already installed.

1. List of Technologies Used

  • Ubuntu 9.04 Jaunty Jackalope Desktop 32-bit
  • Sun JDK 6
  • Eclipse 3.5 Galileo
  • JBoss Application Server (AS) 5.1.0 GA
  • Seam Engine 2.2.0 GA
  • MySQL 5.0
  • JBoss AS Tools 2.1.0-M2
  • Seam Tools 3.1.0-M3
  • Apache Ant 1.7.1

2. Installation Procedures

a. Sun JDK 6

Install Package

1. Open Synaptic Package Manager

2. Install package sun-java6-jdk and its dependencies

Set up Environment

1. Open ~/.profile with a text editor

2. Add environment variable JAVA_HOME to point to your Java directory

e.g. export JAVA_HOME = /usr/lib/jvm/java-6-sun-1.6.0.14

2. Update environment variable PATH to include your Java/bin directory

e.g. export PATH = $JAVA_HOME/bin:$PATH

b. Eclipse 3.5 Galileo

Install Package

1. Open URL http://www.eclipse.org/downloads/

2. Download the appropriate Eclipse IDE package

This post uses Eclipse 3.5 Galileo for Linux 32-bit

3. Extract the contents of the package to a known directory

This post uses ~/Programs/eclipse

c. JBoss Application Server 5.1.0 GA

Install Package

1. Open URL http://www.jboss.org/jbossas/downloads/

2. Download the appropriate JBoss AS binary package

This post uses jboss-5.1.0.GA.zip

3. Extract the contents of the package to a known directory

This post uses ~/Programs/jboss-5.1.0.GA

Set up Environment

1. Open ~/.profile with a text editor

2. Add environment variable JBOSS_HOME to point to your JBoss directory

e.g. export JBOSS_HOME = ~/Programs/jboss-5.1.0.GA

d. Seam Engine 2.2.0 GA

Install Package

1. Open URL http://seamframework.org/Download

2. Download the appropriate Seam Engine binary package

This post uses jboss-seam-2.2.0.GA.zip

3. Extract the contents of the package to a known directory

This post uses ~/Programs/jboss-seam-2.2.0.GA

e. MySQL 5.0

Install Package

1. Open Synaptic Package Manager

2. Install package mysql-server-5.0 and its dependencies

3. Set up the administrative account

The dialog for administrative setup should pop up automatically during the install

4. Open URL http://dev.mysql.com/downloads/connector/j/5.0.html

5. Download the appropriateMySQL Connector/J binary package

6. Extract mysql-connector-java-5.0.8-bin.jar to ~/Programs/jboss-5.1.0.GA/server/default/lib

Set up Environment

1. Open Terminal

2. Log in to mysql using the administrative account

$ mysql –user=<username> –password=<password>

3. Create databases

create database jbossas;

create database test;

f. JBoss AS Tools 2.1.0-M2

Install Package

1. Open Eclipse

2. Navigate to Help -> Install New Software

3. Add Software Site http://download.jboss.org/jbosstools/updates/development

4. Install JBoss AS Tools 2.1.0-M2 and its dependencies

g. Seam Tools 3.1.0-M3

Install Package

1. Open Eclipse

2. Navigate to Help -> Install New Software

3. Add Software Site http://download.jboss.org/jbosstools/updates/nightly/trunk/

4. Install Seam Tools 3.1.0-M3 and its dependencies

h. Apache Ant 1.7.1

Install Package

1. Open URL http://ant.apache.org/bindownload.cgi

2. Download appropriate Ant binary package

This post uses apache-ant-1.7.1-bin.zip

3. Extract the contents of the package to a known directory

This post uses ~/Programs/apache-ant-1.7.1

Set up Environment

1. Open ~/.profile with a text editor

2. Add environment variable ANT_HOME to include your Ant directory

e.g. export ANT_HOME = ~/Programs/apache-ant-1.7.1:$PATH

3. Update environment variable PATH to include your Ant/bin directory

e.g. export PATH = $ANT_HOME/bin:$PATH

3. Configuring JBoss AS in Eclipse

1. Open Eclipse IDE

2. Select J2EE Perspective

a. Navigate to Window -> Open Perspective -> Other

b. Select J2EE

3. In the lower panel, select the Servers tab

4. Add a new JBoss 5.1 Server

The option to create a JBoss 5.1 Server is available with JBoss AS Tools

5. Configure the Server

This post’s JBoss AS home directory is ~/Programs/jboss-5.1.0.GA

This post’s server configuration is “default”

5. Run the Server

6. Test URL http://localhost:8080

The JBoss AS default page should be displayed

4. Creating a New Project

1. Open Terminal

2. Navigate to the Seam Engine directory

3. Add execute permission to seam

$ chmod a+x seam

4. Run seam setup

$ ./seam setup

database is mysql

jdbc driver jar filepath is ~/Programs/jboss-5.1.0.GA/server/default/lib/mysql-connector-java-5.0.8-bin.jar

jdbc driver class is com.mysql.jdbc.Driver

jdbc datasource class is com.mysql.jdbc.jdbc2.optional.MysqlDataSource

jdbc url is jdbc:mysql://localhost:3306/dbname

5. Run seam create-project

$ ./seam create-project

6. Run seam explode

$ ./seam explode

7. Generate entities for any preexisting database tables

$ ./seam generate-entities

8. Import the newly created project as an existing project in Eclipse

9. Configure the Project’s properties to use the correct Seam Engine

a. Navigate to Properties -> Seam Settings

b. Add the Seam 2.2 runtime engine

The option to add Seam 2.2 is available with Seam Tools 3.1.0-M3 (Nightly Build)

5. Conclusion

You should be set!  I wrote this post after I configured my local machine, so it is written to the best of my memory.

Advertisements

7 thoughts on “Setting up JBoss Seam in Ubuntu”

  1. David.

    Thanks a lot.
    This is exactly (including SEAM) what I was looking for.
    Will test it Tomorrow, but the whole post is very detailed.

    Andrei.

  2. Java is the incorporation of making trivial things complex.. that is why i will never use Java in my Projects.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s