Assumptions:
Glassfish is installed in C:/glassfish-v2
The user name for Glassfish is admin and the password is adminadmin.
Step 1:
Download the javapetstore-2.0-ea5-installer.jar file from Sun. I found it at
https://blueprints.dev.java.net/petstore/.
Step 2:
Use javapetstore-2.0-ea5-installer.jar. Execute this jar file (double-click on it) and it will unzip itself in its current directory in a folder called javapetstore-2.0-ea5. Move this directory to the location of your choice for the project. In the remaining instructions it is assumed that you moved it to C:\javapetstore-2.0-ea5.
Step 3:
Locate the file build.properties found in C:\javapetstore-2.0-ea5\bp-project\ and open it with a text editor to make the following changes.
Step 4:
Change javaee.home from:
javaee.home=c:/Sun/SDK
javaee.home=C:/glassfish-v2
Step 5:
Change javaee.server.passwordfile from:
javaee.server.passwordfile=${javaee.home}/samples/bp-project/passwordfilejavaee.server.passwordfile= C:/javapetstore-2.0-ea5/bp-project/passwordfile
Step 6:
In the C:\javapetstore-2.0-ea5\bp-project folder create a file called passwordfile (no extension).
Step 7:
In this file add the following line:
AS_ADMIN_PASSWORD=adminadmin
Step 8:
Start NetBeans and open the project javapetstore-2.0-ea5 that you will find when you browse to C:\javapetstore-2.0-ea5.
Step 9:
Start the GlassFish server. In NetBeans select Window and then Services. A new panel replaces the Projects panel and displays all the services available. Select Servers, right mouse click on Glassfish, and select Start.
Step 10:
In NetBeans return to the Projects panel in the petstore project, go to the Server Resources folder of the project, right mouse click on setup.xml, select Run Target, and select setup. This should create the necessary database files and register them with the persistence engine of GlassFish.
Step 12:
Now Run the main project.
You can find more odds & ends at http://www.omniprogrammer.com.
Ken Fogel