Step-by-Step Guide: Deploying ADF Applications on GlassFish Server
How to Deploy Oracle ADF Applications on GlassFish Server
Oracle Application Development Framework (ADF) applications can be deployed on GlassFish Server with the help of ADF Essentials. This guide walks you through the steps to download, configure, and deploy your ADF application.
Prerequisites
- Oracle GlassFish Server:
Download from the Oracle GlassFish Server download page. - ADF Essentials:
Download the ADF Essentials package from the Oracle ADF Essentials download page.
Step-by-Step Guide
Step 1: Install GlassFish Server
- Download the GlassFish Server package.
- Install it by running the installer and creating a new domain.
- Default domain name:
domain1
.
- Default domain name:
Step 2: Download and Extract ADF Essentials
- Unzip the adf-essentials.zip file into the domain’s directory.
- Example:
unzip -j adf-essentials.zip -d <path_to_glassfish>/domains/domain1
- Example:
Step 3: Start the GlassFish Domain
- Start the GlassFish domain:
asadmin start-domain
- Open the GlassFish Admin Console at:
http://localhost:4848.
Step 4: Configure GlassFish JVM Options
- Navigate to Configurations → server-config → JVM Settings in the GlassFish Admin Console.
- Add the following options under JVM Options:
-Doracle.mds.cache=simple -Duser.timezone=Etc/GMT-2 # Replace GMT-2 with your timezone. -XX:PermSize=256m -XX:MaxPermSize=512m
Step 5: Configure JDBC Resources
- Create JDBC Connection Pool:
- Go to Resources → JDBC → JDBC Connection Pools.
- Add a new connection pool with the following details:
- Resource Type:
javax.sql.XADataSource
. - Datasource Classname: Specify the datasource class for your database.
- Resource Type:
- Create JDBC Resource:
- Go to Resources → JDBC → JDBC Resources.
- Create a new resource (e.g.,
jdbc/hr
) and associate it with the connection pool created earlier.
Step 6: Edit Application Module in ADF Application
- Open your ADF application in JDeveloper.
- Navigate to Application Module properties:
- Right-click the application module → Edit → Properties.
- Configure the data source to use the newly created JDBC resource (
jdbc/hr
).
Step 7: Configure Java EE Application in GlassFish
- Edit the web.xml of your ADF application to match the GlassFish environment.
- Ensure the context-root and paths are set correctly.
Step 8: Deploy and Run ADF Application
- Deploy your ADF application as a
.war
or.ear
file. - Deploy the application on GlassFish:
- Navigate to Applications in the GlassFish Admin Console.
- Click Deploy, and upload the application file.
- Access the deployed application at:
http://localhost:9090/<context-root>/faces/<yourPage>.jspx
Common Configuration Settings
- PermSize and MaxPermSize: Ensure sufficient memory allocation to avoid memory-related errors during deployment.
- Timezone: Set the correct timezone for your environment in the JVM settings.
Troubleshooting Tips
- JDBC Connection Issues:
- Verify the database credentials and connection URL in the GlassFish Admin Console.
- Deployment Errors:
- Check the GlassFish server logs for detailed error messages.
- Page Not Loading:
- Ensure the context-root and page paths are correct.
Conclusion
Deploying an ADF application on GlassFish Server is straightforward when using ADF Essentials. Follow these steps to configure GlassFish and deploy your application successfully. For additional customization or troubleshooting, refer to the official Oracle documentation.
Would you like detailed guidance on any specific configuration or deployment step? 😊