1. GlassFish Application Server
Make sure that the version of Java that your system is using is the Oracle Java SE 6 JDK and not OpenJDK (check this in a terminal window with java -version). If you need to install the Oracle JDK, download Java 6 from the Oracle site and use the update-alternatives utility (see Installing Oracle Java SE 6 for more details)
Create the glassfish user and group. Add the current user along with any other users that should have glassfish admin privileges to the new group.
Log out and log in again with the current user to update the groups. Next, download the Glassfish 18.104.22.168 zip file from http://www.oracle.com/technetwork/middleware/glassfish/overview/index.html. Unzip this file and move the glassfish3 directory to /usr/share/:
Copy the JDBC MySQL driver included with glassfish (mysql-connector-java-commercial-5.1.14-bin.jar) to the glassfish/lib directory:
Change ownership of the glassfish directory to user glassfish and group glassfish:
Copy the example startup script for glassfish from /etc/filteredpush/scripts/glassfish to /etc/init.d/ and make the script executable via the chmod command.
Edit the script and make sure that the JAVA_HOME variable is set to point to the base directory of the Oracle JDK 6. Once you have finished editing the script, install it using the update-rc.d command in terminal. This command will allow the script to automatically start the server on boot and stop it during shutdown:
Start Glassfish via the startup script. The first time you start Glassfish you will be prompted to set the administrative password for the domain:
If you plan on using the admin control panel remotely via a web browser, you must configure the admin user and password and secure access via the asadmin utillity from shell:
Once glassfish has started, navigate to the admin control panel at http://localhost:4848 in a browser window. Enter your admin username and password (default username is admin).
On the left side of the control panel page select Resources > JDBC > JDBC Connection Pools and create a new connection pool with the name "mysql_messagestore". Select "java.sql.ConnectionPoolDataSource" as the Resource Type and "MySQL" as the Database Driver Vendor from the dropdowns before clicking next.
In step two, you should configure the User, Password, DatabaseName, URL and Url properties for the messagestore database:
Once you have done this click the finish button. Select the connection pool again from the list and on the edit page click the "Ping" button to test your configuration (you should get a "Ping Succeeded message").
Now from the list to the left of the control panel, select Resources > JDBC > JDBC Resources and create a new resource with the name "jdbc/mysql_messagestore". Select the mysql_messagestore connection pool you just created from the "Pool Name" dropdown box and click OK to finish.
NOTE: if you end up using a different name for your connection pools you must edit the persistence.xml file in the src/main/resources/META-INF directory of the affected projects.
Now we repeat the process for the fpannotationprocessor database and fpweb user. Create a new connection pool with the name "mysql_fpannotationprocessor" with Resource Type "java.sql.ConnectionPoolDataSource" and Database Driver Vendor "MySQL" in Resources > JDBC > JDBC Connection Pools. Configure the properties on the next page using the following values:
After clicking the Finish button, select the connection pool from the list and click "Ping" to test the connection.
Create a new JDBC resource with the name "jdbc/fpannotationprocessor" in Resources > JDBC > JDBC Resources and select the mysql_fpannotationprocessor connection pool from the "Pool Name" dropdown before clicking OK to finish.