Friday, March 26, 2010

Configuring Seam On Eclipse

SEAM - Next generation enterprise java development

Seam is a powerful open source development platform for building rich Internet applications in Java. Seam integrates technologies such as Asynchronous JavaScript and XML (AJAX), JavaServer Faces (JSF), Java Persistence (JPA), Enterprise Java Beans (EJB 3.0) and Business Process Management (BPM) into a unified full-stack solution, complete with sophisticated tooling.

Seam has been designed from the ground up to eliminate complexity at both architecture and API levels. It enables developers to assemble complex web applications using simple annotated Java classes, a rich set of UI components, and very little XML. Seam's unique support for conversations and declarative state management can introduce a more sophisticated user experience while at the same time eliminating common bugs found in traditional web applications.

To begin development we need to configure seam on an opensource IDEs, one of them is Eclipse.

Here is the configuration :

1. Extract jboss-seam (here I use jboss-seam-2.1.1.GA.tar.gz) on your destination folder (I use D:\java-app\jboss-seam-2.1.1.GA.tar.gz)

2. Extract on D:\java-app folder.

3. Run eclipse.exe on your destination folder above.

4. On your first window choose workbench.

5. jboss tools installation

- extract on D:\java-app
- run eclipse.exe
- choose Help menu -> Software Updates...
- find out jboss tools on your exclipse software updates to ensure jboss is available and works well.

6. Begin project deployment on Seam

seam setup:

- Create a new folder for project on D:\proyek.
Copy mysql-connector-java-5.1.0-bin.jar to D:\proyek
Open command prompt, type D:

type cd java-app\jboss-seam-2.1.1.GA

type seam setup

[input] Enter your Java project workspace (the directory that contains your Seam projects) [C:/Projects] [C:/Projects]

[input] Enter your JBoss AS home directory [C:/Program Files/jboss-4.2.3.GA] [C:/Program Files/jboss-4.2.3.GA]

[input] Enter the project name [myproject] [myproject]

[input] Do you want to use ICEfaces instead of RichFaces [n] (y, [n])

[input] Select a RichFaces skin [classic] (blueSky, [classic], deepMarine, DEFAULT, emeraldTown, japanCherry, ruby, wine)

[input] Is this project deployed as an EAR (with EJB components) or a WAR (with no EJB support) [ear] ([ear], war)

[input] Enter the Java package name for your session beans [com.mydomain.myproject] [com.mydomain.myproject]

[input] Enter the Java package name for your entity beans [com.artmkn.myproject] [com.artmkn.myproject]

[input] Enter the Java package name for your test cases [com.artmkn.myproject.test] [com.artmkn.myproject.test]

[input] What kind of database are you using? [hsql] ([hsql], mysql, oracle, postgres, mssql, db2, sybase, enterprisedb, h2)

[input] Enter the Hibernate dialect for your database [org.hibernate.dialect .MySQLDialect] [org.hibernate.dialect.MySQLDialect]

[input] Enter the filesystem path to the JDBC driver jar [D:\java-app\jboss-seam-2.1.1.GA/lib/hsqldb.jar] [D:\java-app\jboss-seam-2.1.1.GA/lib/hsqldb.jar]

[input] Enter JDBC driver class for your database [com.mysql.jdbc.Driver] [com.mysql.jdbc.Driver]

[input] Enter the JDBC URL for your database [jdbc:mysql:///test] [jdbc:mysql:///test]

[input] Enter database username [sa] [sa]

[input] Enter database password [] []

[input] Enter the database catalog name (it is OK to leave this blank) [] []

[input] Are you working with tables that already exist in the database? [n](y, [n])

[input] Do you want to drop and recreate the database tables and data in import.sql each time you deploy? [n] (y, [n])

[propertyfile] Creating new property file: D:\java-app\jboss-seam-2.1.1.GA\seam-gen\
[echo] Installing JDBC driver jar to JBoss AS
[copy] Copying 1 file to D:\projek\server\default\lib
[echo] Type 'seam create-project' to create the new project


seam create-project

type seam create-project on command prompt
if success the output must be:


type seam generate on command prompt
if success the output must be


seam restart

type seam restart on command prompt and type http://localhost:8080/myproject on your browser as shown below :

No comments:

Post a Comment