For a JSF web application team project you need a web application server that is shared by all members of the team. That is, it is a stand-alone server run on a machine that is up 24/7. The GlassFish server works well when driven by NetBeans but it has some serious problems with database setup when run as a stand-alone server.

Fortunately, the British C2B2 Consulting company has a team that develops Payara, a web application server derived from GlassFish sources. This server fixes the database problems in GlassFish.

In this lab exercise your team will set up a shared Payara server on the UMD CS Department's server machine You will also create a database on Payara's embedded Derby database server and create a JDBC resource for its use in your team project. Finally, all team members will create a NetBeans project for the CS 4531 team project and connect their NetBeans to the shared Derby database.

The NetBeans project for your team will be constructed from sources for a modified version of the database JSF web application. This application will be used for testing the project setup. Its sources and database table can be removed after the set up is tested. This will leave you with a web application server, a database server, and a NetBeans project that will are properly configured for your team project efforts.


The steps for this lab exercise are outlined in the section "Lab Exercise Overview" and detail are given in the following sections. Before you begin your team should decide on some passwords:

These passwords should be reasonably secure. They can be the same.

All team members should log in to the Payara admin Console. Later in this exercise one team member will use it to create a JDBC resource for the project. Later yet, one team member will use the admin console to deploy the project application. During project work other team members may need to to this.

The admin console is a JSF web application. It can be run by pointing your browser to the following url:

Here admin-port is the administrative port reported by the asadmin command when the domain was started. The login name is admin. You will need your team's Payara admin password to log in.

The first time you log in you will get a warning about an insecure connection. You can add a security exception to get past this warning and prevent future warnings.

Click on the "Add Exception..." button to get past the exception and prevent future warnings. This brings up an "Add Security Exception" to confirm the exception.

Click on the "Confirm Security Exception". This will finally bring up the Payara admin console.

The Payara admin console is shown below. After this lab exercise, you will only need it to redeploy your project application after modifications.

Everything you need to do can be started from the left pane by clicking on its tree nodes:

Most team members should log out by clicking on the "Logout" button at the upper right. One team member can stay logged on for upcoming lab exercise steps.

All team members should do the steps below. This will give you the starting point for your team project.

Only one team member should create the database project table.

The database can only be created when the database server is running and NetBeans has a connection to it.

The "Web Pages/misc" folder of the project contains a customers.sql file. Running this file in NetBeans will create the table and insert rows into it.

Be sure to select the new NetBeans connection for your team database!

Only one team member should create a JDBC resource on the Payara server.

Setting up a JDBC resource makes it available to managed beans using resource injection. To create the resource you need to log in to the Payara admin console. Its url is, where admin-port is the administrative port reported by the asadmin command when the domain was started. You will also need the Payara admin password.

There are two parts to Payara resource creation:

One team members should deploy the application.

All team members should view the application with their web browser. It can be run by pointing your browser to the following url:

Here admin-port is the administrative port reported by the asadmin command when the domain was started.

To deploy the application you need to first clean and build the application in NetBeans. Then bring up the Payara admin console and click on the "Applications" node in the left pane. You should get the screenshot below. Click on the "Deploy" button. This brings up the "Deploy Applications or Modules" dialog.

All you need to do here is use the "Browse" button to locate the project WAR file in your project's dist folder. Then click on the "OK" button. After a short delay the application should appear in the console's application list.

All team members should remove the Web Pages/misc/customers.sql file. You may later want to add your own file for recreating database tables here.

One team member should remove the customers table from the database. You can do this in the NetBeans "Services" pane by connecting to the project connection, expanding its node, then the "APP" subnode, then the "Tables" subnode. Right-click on the table and select "Delete" from the popup menu.