Preparing Oracle ADF 12.2.1.4 application on Glassfish 4.1

This tutorial will guide you through the steps of deploying ADF Essentials Summit Sample application on Glassfish server. For this purpose we are going to use two Docker containers, one for Summit DB and one for Summit Application server (Glassfish 4.1 Recommended by Oracle).

Prerequisites

To walk through the tutorial you will need to have the following components installed in your development environment.

  1. Docker

You will also need to visit Oracle XE Docker hub site Login Proceed to checkout and follow the steps providing your contact information, accepting the license agreement, so that you can get the docker content for Oracle XE server.

Prepare your application db

From Oracle JDeveloper and Oracle ADF 12c (12.1.3.0) — Code Samples Download Summit application and schema ZIP, and extract the content in a temporary location.

  • Create the following folder structure 

 

summit-adf-glassfish/
|─ summit-db/
| ├─ init/
| ├─ scripts/
| ├─ Dockerfile

  • Copy all files from uncompressed Summit_Schema/Database/scripts to your summit-db/scripts folder.

  • Create summit-db/init.sh script with the following content.

#!/bin/bash
cd /scripts
sqlplus system/oracle@localhost @build_summit_schema.sql

  • Create summit-db/Dockerfile with the following content.

FROM oracleinanutshell/oracle-xe-11g
ADD init/init.sh /docker-entrypoint-initdb.d/01_init.shADD scripts/ /scripts/

Now we are ready to test our Database.

#Create Network
docker network create -d bridge ADFSummitNET
#Build Docker Image
docker build -t ancapit/summitdb .
#Start Docker Container
docker run -d -p 1521:1521 --network=InfraNET -p 5500:5500 --name summit-db ancapit/summitdb

Connect to your database using 

jdbc:oracle:thin:@172.18.0.2:1521:XE with username c##summit_adf and password summit_adf and you should be able to see your C##SUMMIT_ADF schema.

Prepare your application server

Now let’s get our Glassfish server up and running in a docker container. To achieve this we will follow Oracle Official documentation and automate each step in a Dockerfile.

  • Navigate to your project and add summit-server folder to it. 
  • Add a webapps folder inside summit-server. You will put your EAR file in this location.
  • Download adf-essentials.zip from Oracle ADF Essentials, For this tutorial we used the 
  • Download Basic Client RPM from Oracle instant client website.
  • Locate com.oracle.webservices.fmw.client.jar (You can find it in JDeveloper installation folder) in your summit-server/lib folder.
  • Create a Dockerfile with the following content. And copy the content from our Github repository

You should end up with the following directory structure:

summit-adf-glassfish/
├─ summit-db/
│ ├─ init/
│ ├─ scripts/
│ ├─ Dockerfile
├─ summit-server/
│ ├─ webapps/
│ ├─ lib/
│ │ ├─ com.oracle.webservices.fmw.client.jar
│ │ ├─ oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm
│ ├─ adf-essentials.zip
│ ├─ Dockerfile

Prepare your application for deployment

Follow Deploying Oracle ADF Summit Core Sample To EAR for Glassfish to generate your Summit applications EAR file and copy it into your /project/summit-server/webapps folder. 

Ready to Race!

Now we are ready to get our application up and running. Follow the following steps to start your application server docker. 

#Build Docker Image
docker build -t ancapit/summit-server .
#Start Docker Container
docker run -d -p 8080:8080 –network=InfraNET –name summit-server ancapit/summit-server

Now you should be able to access http://localhost:8080/SummitADF-ViewController-context-root/faces/index.jsf and see something like this in your browser.

1 thought on “Preparing Oracle ADF 12.2.1.4 application on Glassfish 4.1”

  1. When I originally commented I clicked the “Notify me when new comments are added” checkbox and now
    each time a comment is added I get several e-mails with the same comment.
    Is there any way you can remove me from that service?
    Appreciate it!

Leave a Comment

Your email address will not be published. Required fields are marked *