My previous post might be not run, but this post is fully tested by me and it is working. You can go throught stet by step.
Software Required.
1. jboss-seam-2.1.1.GA
2. jboss-4.2.0.GA
3. Eclipse Europa
4. PostgreSQL 8.1.0
Suppose you have all these software in C drive. (I am assuming.)
Please copy database drive jar file into jboss-seam lib. (Copy C:\PostgreSQL\8.1\jdbc\postgresql-8.1dev-403.jdbc2ee.jar INTO C:\jboss-seam-2.1.1.GA\lib)
Step1 : Create one workspace like C:\Workspace_Seam
Step2: Open dos prompt
c:\jboss-seam-2.1.1.GA>seam setup
It will ask many configuration, put value as below
Enter you java project workspace : C:\Workspace_Seam
Enter your JBoss AS home directory: c:\jboss-4.2.0.GA
Enter the Project name : Binod_SEAM_Proj
Then put three time enter key (Accepting default values)
Enter Java package name for your session bean : com.suman.session
Enter Java package name for your entity bean : com.suman.entity
Enter Java package name for your test cases : com.suman.test
What kind of database are you using : postgres
Enter the Hibernate dialect for your database : org.hibernate.dialect.PostgreSQLDialect
Enter the filesystem path to JDBC driver jar : C:\PostgreSQL\8.1\jdbc\postgresql-8.1dev-403.jdbc2ee.jar
Enter JDBC drive class for your database : org.postgresql.Driver
Enter JDBC URL for your database : jdbc:postgresql://localhost:5432/postgres
Enter database user name: postgres
Enter database password: suman
Put enter key 5 times to set default value.
Step3:c:\jboss-seam-2.1.1.GA> seam create-project
It will create one folder Binod_SEAM_Proj (Your project name) in C:\Workspace_Seam (Your workspace). And copy a lot of files including one project in Binod_SEAM_Proj folder.
Step4:
c:\jboss-seam-2.1.1.GA> seam generate
It will build the application and generate ear file i.e. Binod_SEAM_Proj.ear inside the C:\Workspace_Seam\Binod_SEAM_Proj\exploded-archives folder.
Step5:
c:\jboss-seam-2.1.1.GA> seam deploy
It will deploy the application and copy Binod_SEAM_Proj.ear to C:\jboss-4.2.0.GA\server\default\deploy
Step6: Start the jboss server
C:\jboss-4.2.0.GA\bin>run.bat
You will get message in server console like this
00:40:10,406 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-4.2.0.GA/server/default/deploy/Binod_SEAM_Proj.ear/
Step7:
Open internet explorer and type
http://localhost:8080/Binod_SEAM_Proj
You will get one page having written
Welcome to Seam!
Your seam-get project is deployed! Here are some ...........
Step8:
Open Eclipse and put the workspace C:\Workspace_Seam
File -> Import -> General -> Existing Projects into Workspace -> Browse -> choose Binod_SEAM_Proj
Goto C:\jboss-seam-2.1.1.GA\examples\registration\src\org\jboss\seam\example\registration
and copy Register.java and RegisterAction.java and paste into Eclipse Binod_SEAM_Proj->src/hot-> suman.session
It will show some exception. So change the package in both java file from
package org.jboss.seam.example.registration; to package suman.session;
It will show one more exception, that would be solve in next step.
Step9:
Copy User.java from C:\jboss-seam-2.1.1.GA\examples\registration\src\org\jboss\seam\example\registration into Eclipse Binod_SEAM_Proj -> src/main -> suman.entity. Change the package name from
package org.jboss.seam.example.registration; to package suman.entity;
Now there woule not be any exception.
Step10: Go to E:\SEAM\jboss-seam-2.1.1.GA\jboss-seam-2.1.1.GA\examples\registration\view and copy all files. (index.html, register.xhtml, registered.xhtml) into Eclipse Binod_SEAM_Proj -> View. (Overwrite all files).
Step11:
Stop the jboss server
Delete Binod_SEAM_Proj.ear from C:\jboss-4.2.0.GA\server\default\deploy
Step12: Right click on build.xml -> Run As -> Ant Build
Again it will build the application and deploy the application.
Start the jboss server C:\jboss-4.2.0.GA\bin>run.bat
Open internet explorer and put
http://localhost:8080/Binod_SEAM_Proj2
You will get User Entry form having Username, Real Name, Password
Put data in all these text field and click on Register button.
You will get one confirmation message.
Now go to database, here one table is created with name users. That will have all the above given information.
Thats it .................. :)