File lay out: ------------- The entity classes and persistence.xml is in entities sub-dir. The servlet classes and web.xml is in web-app1 sub-dir. Classes belong to example package. build artifacts go to build directory by default. Build steps: ------------ change glassfish.home property in build.xml. glassfish.home property points to the root of the application server installation directory. Build processes uses the javaee.jar file from the appserver location. javaee.jar contains all the standard Java EE API classes. ant build: produces build/web-app1.war 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-app1/login.html Before you run, you must create tables in database. See instructions below: Set up Derby database: ---------------------- Start Derby: $GLASSFISH_HOME/bin/asamdin start-database Use the following instructions for creating a table in Derby: export DERBY_INSTALL=$GLASSFISH_HOME/derby/ ksh $DERBY_INSTALL/frameworks/NetworkServer/bin/ij.ksh > connect 'jdbc:derby://localhost:1527/sun-appserv-samples;user=APP;password=APP'; > create table USERCREDENTIAL (NAME VARCHAR(10) NOT NULL, PASSWORD VARCHAR(10) NOT NULL, PRIMARY KEY(NAME)); > commit; 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. 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 change user name and password to whatever you used during installtion. To undeploy an app: asadmin undeploy --user admin --passwordfile .adminpassword.txt