Source code lay out: -------------------- blog5 entities -- entity source code and persistence.xml ejbs -- ejb classes are here. web-app2 -- servlet source code, html pages and web.xml are here. appclient -- application client code is here. build.xml Build steps: ------------ change glassfish.home property in build.xml. glassfish.home property points to the root of the application server installation directory. The only external library used by build process is javaee.jar which contains all the standard Java EE API classes. ant build: produces build/blog5.ear ant deploy: deploys the app to app server. ant verify: verifies compliance of the app against Java EE spec. To run the application ---------------------- open http://localhost:8080/web-app2/login.html This uses the servlets. To run the application client, run: $GLASSFISH_HOME/bin/appclient -client $GLASSFISH_HOME/domains/domain1/generated/xml/j2ee-apps/blog5/blog5Client.jar Note, there is a special option in asadmin deploy called --retrieve which can be used to download the blog5Client.jar to a directory of your choice. Run asadmin deploy --help for more details. Database Setup: --------------- No need to set up data sources or create tables. The application uses Java2DB feature in glassfish and creates the table automatically during deployment (See --createtables option used in build.xml). This creates a table called "USERCREDENTIAL" with two columns called "NAME" and "PASSWORD" in database called sun-appserv-samples. This is the default Derby database that Sun App Server uses if no data source details are supplied in persistence.xml. So all you need to do is to start Derby by running the following command: $GLASSFISH_HOME/bin/asamdin start-database You are free to use any other database that you like. To do that you have to create a datasource (refer to app server document for this) and configure persistence.xml. Some common Sun Java System Application Server commands: -------------------------------------------------------- To start the appserver: asadmin start-domain To stop the appserver: asadmin stop-domain To deploy an app: asadmin deploy --user admin --passwordfile .adminpassword.txt --createtables --retrieve /tmp change user name and password to whatever you used during installtion. To undeploy an app: asadmin undeploy --user admin --passwordfile .adminpassword.txt