How to Configure WebUtil in Oracle Forms 11g – A Step-by-Step Guide

 

Introduction

Oracle Forms 11g lacks native support for client-side operations, such as file selection dialogs, clipboard access, or interactions with Microsoft Office. WebUtil bridges this gap by enabling Oracle Forms applications to perform these client-side operations.

This guide provides a detailed step-by-step procedure to configure WebUtil in Oracle Forms 11g, complete with actual commands.

1.      Prepare the Database Schema for WebUtil

Before using WebUtil, you must create the necessary database objects by executing the create_webutil_db.sql script.

 

Connect to the database as SYSDBA:

$  sqlplus / as sysdba

 


Create a dedicated WebUtil user :

SQL>CREATE USER webutil IDENTIFIED BY webutil DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;

 

SQL> GRANT CONNECT, RESOURCE, CREATE SYNONYM, CREATE PUBLIC SYNONYM TO webutil;


Run the WebUtil database script from application server:

$ sqlplus webutil/webutil@DB_SID $ORACLE_HOME/forms/create_webutil_db.sql


1.      Download and Place the JACOB Library Files

WebUtil depends on the JACOB library to interact with Windows-based applications.

Download the Required JACOB Version

·         For Forms 11g Release 1 (11.1.1.X) → JACOB 1.10.1

·         For Forms 11g Release 2 (11.1.2.X) → JACOB 1.14.3

 

The JACOB version can be downloaded from following github site

https://github.com/freemansoft/jacob-project/releases


1.      Copy JACOB Files to Oracle Forms

After downloading the JACOB files, extract to the  ZIP file:

Copy the files in following path of application server

copy jacob.jar $ORACLE_HOME/forms/java/

 

1.        Place the JACOB DLL Files

Place the JACOB DLL files in the correct directories:

For Forms 11g Release 1 (11.1.1.X):


copy jacob.dll $ORACLE_HOME/forms/webutil/



Forms 11g Release 2 (11.1.2.X):

cd jacob-1.14.3

cp jacob-1.14.3-x86.dll $ORACLE_HOME/forms/webutil/win32/

cp jacob-1.14.3-x64.dll $ORACLE_HOME/forms/webutil/win64/


1.      Sign the JACOB JAR File

To avoid security issues when running Forms, sign the jacob.jar file using Oracle's provided script.

Before sign, change the following in $ORACLE_INSTANCE/bin/sign_webutil.sh  file

SET JAR_KEY_PASSWORD=Password123#

SET KEYSTORE_PASSWORD=Password123#

SET VALIDDAYS=3600

 


cd $ORACLE_INSTANCE/bin

$ sh sign_webutil.sh $ORACLE_HOME/forms/java/jacob.jar


1.      Update CLASSPATH in default.env

Modify default.env to include the necessary JAR files.

cd $DOMAIN_HOME/config/fmwconfig/servers/WLS_FORMS/applications/formsapp_11.1.2/config

 

Add following parameter

 

CLASSPATH=$ORACLE_HOME/forms/java/frmall.jar

 



1.      Modify the formsweb.cfg Configuration File

cd $DOMAIN_HOME/config/fmwconfig/servers/WLS_FORMS/applications/formsapp_11.1.2/config

 

Add following [webutil] configuration

 

[webutil]

WebUtilArchive=frmwebutil.jar,jacob.jar

baseHTMLjinitiator=webutiljini.htm

baseHTMLjpi=webutiljpi.htm

archive_jini=frmall_jinit.jar archive=frmall.jar

Form=webutil_demo.fmx

Userid=username/password@DB_SID

##Provide db username and password and DBsid to connect the DB

 

Save and exit.


1.      Compile and Deploy webutil_demo.fmb

First download webutil_demo.fmb from following url and place it in application server

https://www.dropbox.com/s/mdkhjh7997r8arh/webutil_demo.fmb?dl=0

 

Open form builder and compile the form webutil_demo.fmb and place it under

$ORACLE_HOME/forms location. 

Or compile it using command

$ Cd $ORACLE_HOME/bin

$ frmcmp module=webutil_demo.fmb module_type=form userid=webutil/webutil_password@yourdb compile_all=yes

 

 


1.      Compile webutil.pll to create webutil.plx

$ cd $ORACLE_HOME/bin
$ frmcmp module=webutil.pll module_type=library userid=webutil/webutil_password@yourdb compile_all=yes

 


Restart Oracle Forms and weblogic services

$ cd $ORACLE_INSTANCE/bin

$ ./opmnctl stopall

 

 

#Stop reports services

cd $DOMAIN_HOME/bin

 

./stopManagedWebLogic.sh WLS_REPORTS

 

#stop forms services

 

./stopManagedWebLogic.sh WLS_FORMS

 

 

#stop weblogic admin server

 

./stopWebLogic.sh

 

#start weblogic admin server

 

cd $DOMAIN_HOME/bin

 

nohup ./startWebLogic.sh > /dev/null 2>&1 &

 

#Wait for sometime to start the admin server

 

#start forms services

 

nohup ./startManagedWebLogic.sh WLS_FORMS > /dev/null 2>&1 &

 

 

#Start reports services

 

nohup ./startManagedWebLogic.sh WLS_REPORTS > /dev/null 2>&1 &

 

#start opmn

 

$ cd $ORACLE_INSTANCE/bin

./opmnctl startall

./opmnctl status


1.      Test WebUtil Configuration

http://your_server_hostname:port/forms/frmservlet?config=webutil


This should open a window like below




Automating Oracle Forms 11g Compilation with a Shell Script

 

Automating Oracle Forms 11g Compilation with a Shell Script

In the world of Oracle applications, managing and compiling forms can be a time-consuming task, especially when dealing with a large number of forms. Fortunately, with the power of shell scripting in Linux, we can automate this process to save time and reduce errors. In this blog post, we will guide you through creating a shell script that compiles multiple Oracle Forms 11g or 12c in one go.

Why Automate Form Compilation?

Compiling Oracle Forms is essential for ensuring that your applications run smoothly. When changes are made to forms, they need to be recompiled to reflect those changes in the application. Manually compiling each form can be tedious and prone to human error, particularly when you have dozens or even hundreds of forms to process. By automating this task, you can:

  • Save Time: Compile multiple forms simultaneously without manual intervention.
  • Reduce Errors: Minimize the risk of missing a form or making mistakes during the compilation process.
  • Increase Efficiency: Focus on more critical tasks while the script handles the repetitive work.


Below is a shell script designed to compile all .fmb files in a specified directory for Oracle Forms 11g.


#!/bin/bash

. .bash_profile

 export FR_INST=/u01/app/oracle/product/fmw11g/asinst_1

 # Database credentials

USERNAME="scott"

PASSWORD="tiger"

DATABASE="prod"

 # Directory containing the forms

FORMS_DIR="/home/oracle/forms"

 

# Change to the forms directory

cd $FORMS_DIR || { echo "Directory not found: $FORMS_DIR"; exit 1; }

 

# Compile all forms

echo "Starting compilation of Oracle Forms..."

 

for form in *.fmb; do

    if [ -f "$form" ]; then

        echo "Compiling $form..."

        $FR_INST/bin/frmcmp_batch.sh Module_type=form Module="$form" userid="$USERNAME/$PASSWORD@$DATABASE"  batch=yes  compile_all=yes

       

        if [ $? -ne 0 ]; then

            echo "Error compiling $form"

        else

            echo "$form compiled successfully."

        fi

    fi

done

 

echo "Compilation process completed."

 

 

Instructions for Using the Script

  1. Modify Variables:
    • Update ORACLE_HOME, USERNAME, PASSWORD, DATABASE, and FORMS_DIR with your actual Oracle installation path and database credentials.
  2. Save the Script:
    • Save this script to a file, for example, compile_forms.sh.
  3. Make it Executable:

              chmod 777 compile_forms.sh

  1. Run the Script:
    • Execute the script in your terminal:

./compile_forms.sh

Key Components of the Script

  • Environment Variables: The script sets up necessary environment variables such as ORACLE_HOME and updates the PATH to include Oracle binaries.
  • Looping Through Forms: It uses a for loop to iterate through all .fmb files in the specified directory.
  • Error Handling: After each compilation attempt, it checks for errors and provides feedback on whether each form was compiled successfully or if there was an error.