Seam Apps Development - Steps to Create and Deploy a Prototype Application

Seam Apps Development - Steps to Create and Deploy a Prototype Application

Lets see how to do Rapid Application Development from existing database using Seam - Gen tool provided by seam

1, open command prompt and go to the location where seam is extracted
ex : D:\BonAppetit_Product\jboss-seam-2.2.0.GA

2, if you get problem :The JAVA_HOME environment variable should point to a JDK, not a JRE
solution : right-click "My computer", Properties ->Advanced Tab -> Environmental Variables,
and click "New" button to add JAVA_HOME environmental variable .

Provide following values:
a, variable name : JAVA_HOME
b, variable value : (for ex:) C:\Program Files\Java\jdk1.6.0_21

and click ok and do step-1 again .

3, type "seam setup" command and do as defined below :

[echo] Welcome to seam-gen :-)
[input] Enter your Java project workspace (the directory that contains
your Seam projects) [C:/Projects] [C:/Projects]
D:\BonAppetit_Product\Eclipse\Workspace_BonAppetit_Product

[input] Enter your JBoss home directory [C:/Program Files/jboss-4.2.2.GA]
[C:/Program Files/jboss-4.2.2.GA]
D:\BonAppetit_Product\jboss-5.1.0.GA

[input] Enter the project name [myproject] [myproject]
BonPro
[echo] Accepted project name as: BonPro

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

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

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

[input] Enter the Base package name for your Java Classes
[com.mydomain.Bonpro] [com.mydomain.Bonpro]
com.Bonpro

[input] Enter the Java package name for your session
beans [com.Bonpro.action] [com.Bonpro.action]
com.Bonpro.action

[input] Enter the Java package name for your entity beans
[com.Bonpro.model] [com.Bonpro.model]
com.Bonpro.model

[input] Enter the Java package name for your test cases
[com.Bonpro.action.test] [com.Bonpro.action.test]
com.Bonpro.test

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

[input] Enter the Hibernate dialect for your database
[org.hibernate.dialect.PostgreSqlDialect] [org.hibernate.dialect.PostgreSqlDialect]
Hit Enter key (automatically generated one !!!)

[input] Enter the filesystem path to the JDBC driver jar [lib/h2.jar]
D:\BonAppetit_Product\jboss-5.1.0.GA\postgresql-8.4-701.jdbc4.jar

[input] Enter JDBC driver class for your database [org.h2.Driver]
[org.postgresql.Driver]
Hit Enter key (automatically generated one !!!)

[input] Enter the JDBC URL for your database [jdbc:postgresql:.] [jdbc:postgresql:.]
jdbc:postgresql:sample
(format : jdbc:postgreql:database name)

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

[input] Enter database password [] []
postgres

[input] Enter the database schema name (it's OK to leave it blank) [] []
Hit Enter key (automatically generated one !!!)

[input] Enter the database catalog name (it's OK to leave it blank) [] []
Hit Enter key (automatically generated one !!!)

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

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

[propertyfile] Creating new property file:
D:\BonAppetit_Product\jboss-seam-2.2.0.GA/seam-gen/build.properties
[echo] Installing JDBC driver jar to JBoss server
[copy] Copying 1 file to
D:\BonAppetit_Product\jboss-5.1.0.GA\server\default\lib
[echo] Type 'seam create-project' to create the new project
BUILD SUCCESSFUL

Now, you had configured settings for the project. To create project , go to next step .

4, Now type 'seam create-project' and it will create a new project for you in the workspace location provided by you in the above step

5, Then type 'seam generate'

6, Now open eclipse -> New -> General - > Existing Projects into WorkSpace -> Select root Directory (as given by you in step - 3) -> Finish

7, Once imported, the project will automatically build and will get deployed in the JBoss server.

8. Now start the JBoss server and browse following URL :
(for ex :) http://localhost:8080/BonPro(Project name provided by you in step-3)
(format : http://localhost:8080/project-name)

Now we have created a sample prototype application
using seam-gen from an existing database !!!

0 comments:

Post a Comment

Popular Posts