A Configuring GlassFish Server

This appendix describes how to configure GlassFish Server for Oracle ADF Essentials. It describes how to obtain the Oracle ADF Runtime and how to install these files into the GlassFish Server

This appendix contains the following sections:

A.1 About Configuring GlassFish

GlassFish Server is an application server that can be configured to run Oracle ADF applications. If you do not have a GlassFish Server installation, you can download GlassFish Server from the GlassFish website. Before you can run ADF applications in a GlassFish Server, you need to configure GlassFish with the Oracle ADF Runtime libraries.

For a list of the supported Oracle ADF features for GlassFish, go to the OTN site at http://www.oracle.com/technetwork/developer-tools/adf/overview/adfessentials-1719844.html

For instructions on obtaining and installing GlassFish, see https://glassfish.java.net/download.html

For information about developing ADF applications for GlassFish, see the "Deploying ADF Applications to GlassFish" appendix in the Developing Fusion Web Applications with Oracle Application Development Framework.

A.2 Obtaining GlassFish Server and Oracle ADF Runtime

Oracle ADF Essentials supports the Open Source and commercial versions of GlassFish Server. With either version, you will need the Full Platform distribution. The Web Profile distribution is not supported. After you have installed the GlassFish Server, you need to obtain the ADF Essentials adf-essentials.zip file from OTN and follow the instructions in this appendix to install the ADF Runtime libraries.

For information on how to start and stop the server and other application server tasks, see GlassFish documentation at the GlassFish website.

You will need to perform the following tasks, as described in the following topics:

A.2.1 Obtaining GlassFish Server

You can download the open source version of the GlassFish Server from the GlassFish website:

https://glassfish.java.net/download.html

Note:

You must download Java EE 7 Full Platform (not Java EE 7 Web Profile) since it includes enterprise class features like JMS.

Follow the instructions and documentation at the GlassFish site to install and configure a GlassFish Server.

Note:

Before installing ADF Essentials your installation of GlassFish Server at /glassfish–4.1/glassfish/modules/javax.el.jar must be patched with javax.el–3.0.1-b08.jar available for download at https://java.net/projects/uel/sources/svn/show/tags/javax.el-3.0.1-b08.

A.2.2 Obtaining Oracle ADF Runtime

In order for a GlassFish Server to run Oracle ADF applications, you must install the ADF Runtime library files into the GlassFish installation directory.

You can download the Oracle ADF Essentials adf-essentials.zip file from the Oracle Technology Network at http://www.oracle.com/go/?&Src=7578263&Act=4&pcode=WWMK12022244MPP044.

After you have downloaded the adf-essentials.zip file, you can extract the files to a flat-structured temporary directory which you can use to copy the required files into the GlassFish installation directories.

For instance, if you are using unzip, you can add the -j option to create a flat directory structure that has no hierarchical folders.

unzip -j <file> -d <destination>

A.3 Configuring GlassFish with ADF Runtime Libraries

The ADF Runtime libraries consists of the following:

  • ADF Share libraries

  • ADF Certified Compatible JSF Implementation

  • ADF Model libraries

  • ADF Controller libraries

  • ADF View libraries

The ADF Share libraries and ADF Certified Compatible JSF Implementation must be manually installed into the GlassFish installation. You use your operating system commands or tools to copy the files into GlassFish. For instructions, see Installing ADF Share Libraries Manually

The ADF Model, ADF Controller, and ADF View libraries are loaded into GlassFish with the deployed application. When you use JDeveloper to develop the application, you will reference the required libraries before you package the application into an EAR file for deployment.

The steps for installing the ADF Runtime libraries are:

  1. Configure ADF Share libraries.
    • Copy the ADF Share libraries from adf-essentials.zip into the GlassFish installation.

  2. Deploy the application as an EAR file to GlassFish Server.

A.3.1 Installing ADF Share Libraries Manually

It may be helpful to have an understanding of the options that are available to you when you are mapping ADF Share for GlassFish. For more information, see Configuring GlassFish with ADF Runtime Libraries

You will need to complete these tasks:

To install the ADF Share Runtime libraries:

  1. Copy or move the ADF Share library files from the temporary directory to the <glassfish>/domains/domain1/lib/applibs folder:

    The ADF Share files should be in the temporary directory where you had unzip the adf-essentials.zip file as described in Obtaining Oracle ADF Runtime This directory should be <temp>/oracle_common/modules.

    You must copy the following JAR files into the <glassfish>/domains/domain1/lib/applibs directory:

    oracle.adf.share.ca_12.2.1/adf-share-base.jar
    oracle.adf.share.ca_12.2.1/adf-share-ca.jar
    oracle.adf.share_12.2.1/commons-el.jar
    oracle.adf.share_12.2.1/adf-share-support.jar
    oracle.adf.share_12.2.1/adfsharembean.jar
    oracle.adf.share_12.2.1/jsp-el-api.jar
    oracle.adf.share_12.2.1/adflogginghandler.jar
    oracle.adf.share_12.2.1/oracle-el.jar
    oracle.mds_12.2.1/mdsrt.jar
    oracle.bali.share_12.2.1/share.jar
    oracle.xmlef_12.2.1/xmlef.jar
    oracle.javatools_12.2.1/resourcebundle.jar
    oracle.javatools_12.2.1/javamodel-rt.jar
    oracle.javatools_12.2.1/javatools-nodeps.jar
    oracle.javatools_12.2.1/oicons.jar
    oracle.adf.security_12.2.1/adf-share-security.jar
    oracle.adf.security_12.2.1/adf-controller-security.jar
    oracle.xdk_12.2.1/xmlparserv2_sans_jaxp_services.jar
    oracle.xdb_11.1.0.jar
    oracle.jrf_12.2.1/jrf-api.jar
    oracle.jdbc_11.2/ojdbc6dms.jar
    oracle.dms_12.2.1/dms.jar
    oracle.odl_12.2.1/ojdl.jar
    oracle.odl_12.2.1/ojdl2.jar
    oracle.classloader_11.1.1.jar
    oracle.logging-utils_11.1.1.jar
    oracle.web-common_12.2.1.jar
    org.apache.bcel_5.1.jar
    oracle.nlsrtl_11.2.0/orai18n-mapping.jar
    org.apache.commons.beanutils_1.8.3
    org.apache.commons.logging_1.1.1
    oracle.jsp_12.2.1/globaltldcache
    oracle.mds_12.2.1/mdsrt
    com.oracle.webservices.fmw.oc4j-ws-support-impl_12.2.1
    oracle.http_client_12.2.1
    oracle.web-common_12.2.1
    oracle.web-common-schemas_12.2.1
    
    
  2. Verify the libraries.

To install the ADF Certified Compatible JSF Implementation:

  1. Download the javax.faces-2.2.8-11.jar file from Maven Central.
  2. Remove the version number to rename the downloaded file to javax.faces.jar.
  3. Copy the renamed file to the glassfish4/glassfish/modules/ directory to overwrite the javax.faces.jar file in the target directory.

    The ADF Certified Compatible JSF Implementation is backward compatible with the one which is already present in GlassFish 4.1.

A.4 Additional Configuration Tasks

After you have installed the ADF Runtime into the GlassFish Server, you need to perform additional configuration tasks on GlassFish.

The configuration tasks are:

A.4.1 Using the GlassFish Administration Console

You can use the GlassFish Administration Console to configure the GlassFish Server including managing applications, JDBC pools, and other resources. If you are using GlassFish 3.1.2, the secure console is disabled by default. You would need to enable secure console to access the admin page remotely or only access the page from the same machine where the GlassFish server is running.

The GlassFish Administration Console is at:

http://<machine_name>:4848/

A.4.2 Creating a Datasource for GlassFish

It may be helpful to have an understanding of the options that are available to you when you are creating a datasource for GlassFish. For more information, see Additional Configuration Tasks.

You can use the GlassFish console or use asadmin commands to create the datasource. For using the GlassFish console to create a datasource, see GlassFish documentation.

To create a datasource for GlassFish using asadmin commands:

  1. Open a command line window.
  2. Invoke the asadmin command to create a datasource for GlassFish.

    For instance, the following command creates a datasource for an application:

    asadmin> create-jdbc-connection-pool --datasourceclassname
      oracle.jdbc.pool.SampleDataSource
      --restype javax.sql.XADataSource
      --property user=xyz
      :password=xyz:url=jdbc:oracle:thin:@machine.com:1521:machine
      --target=server SampleDSPool
     
    asadmin> ping-connection-pool sampleDSPool
     
    asadmin> create-jdbc-resource --connectionpoolid SampleDSPool jdbc/OracleDS
    
    

A.4.3 Configuring the JVM Cache

You need to configure the JVM settings to simple and increase the memory size from 192 Mb to 512 Mb.

It may be helpful to have an understanding of the options that are available to you when you are configuring JVM for GlassFish. For more information, see Additional Configuration Tasks

To configure JVM Cache for MDS:

  1. Start the GlassFish Administration Console.

  2. Choose Configurations > server-config > JVM Settings.

  3. Select JVM Options and specify -Doracle.mds.cache=simple and XX:MaxPermSize=512m.

  4. Click Save.

  5. Or, open the <glassfish>/domains/domain1/config/domain.xml file and edit the following entries:

    <jvm-options>-XX:MaxPermSize=512m</jvm-options>
    <jvm-options>-Doracle.mds.cache=simple</jvm-options>

A.5 Deploying an ADF Application to GlassFish

After you have referenced the libraries in the application, you can proceed to deploy the application to GlassFish Server. For more information, see the "Deploying ADF Applications to GlassFish" appendix in the Developing Fusion Web Applications with Oracle Application Development Framework.