How To Configure Forms Builder To Run Forms Locally
How To Configure Forms Builder To Run Forms Locally
Introd u ction
I wrote this document because so many people in the Oracle Technology Network (OTN) Forms Forum have asked How do I run a form from the Forms Builder? or I just installed
Forms 10g and all I get is a blank browser window when I run a form. After I responded to numerous posts (always writing the instructions from scratch) I decided to write this
document. As they say, It is always better to reuse then to recreate!
Disclaimer
First and foremost, this document targets the following Oracle Developer Suite (Forms/Reports) versions: 10g R1 (9.0.4.x.x) and 10g R2 (10.1.2.x.x).
Many of the concepts apply to the Oracle Fusion Middleware (FMw) 11g suite (Forms and Reports), but this document is not intended to help you with FMw configuration.
The information in this document could be adapted to Oracle Forms 9i, but I do not currently have access to this version of Forms so there is no guarantee that these methods will work
for Forms 9i.
Secondly, this document is NOT all inclusive meaning it is not a full reference to all setup options available. This document is meant only to get you up and running. If you need to
use features that are not listed in this document, please refer to the appropriate Oracle document available at the Oracle Technology Network (OTN).
Lastly, this article assumes you have successfully installed the Oracle Developer Suite (ODS) 10g R2 (10.1.2.x.x). If you have not already installed the ODS then you will need to do
this before you can proceed.
Background
If you have used Oracle Forms long enough, you will remember the day when you could run a Form locally from the Forms Builder with the Forms Runtime. This was a very nice
feature that enabled you to perform incremental development and testing; the Forms Debugger utility; not to mention the Forms Runtime Diagnostics (FRD). With the advent of Forms
9i when Oracle made Forms web deployed only many developers thought the ability to run a form from the Forms Builder was lost. This is not true; it is just a little harder to do now
and requires some configuration setup on your workstation to make it work. Forms 10g use the OC4J Forms Servlet to emulate a Forms Service web process on your workstation that
allows you to serve a web form from the Forms Builder. This is a very generic description of what OC4J is and what it does, but it will suffice for the purpose
of this document. In order to run a form from the Forms Builder, Oracle has included two new program items (among others) in Oracle Developer Suite Program group of the installed
Oracle Developer Suite 10g. These two program items are the Start OC4J Instance and Stop OC4J Instance. Both are critical to the running of forms from the Forms Builder.
Java Runtime
Windows
Jinitiator
Sun JRE
Internet
Explorer
version 5 1.3.1.x+
1.4.1+
version 6 1.3.1.22+
1.4.2_06+
version 7 1.3.1.28
1.5.0_06+
version 8 1.6.0_16+
1.6.0_16+
FireFox 3.5+
NS
1.6.0_16+
+ = indicates a higher version can be used
NS = Not Supported
This list is an abbreviated list. For a complete list review the appropriate Oracle Certification Matrix document on OTN.
Alright, enough background. Its time to get the heart of this document.
This document will be focused into three sections: Forms Builder config, OC4J with Jinitiator, and OC4J with Sun JRE.
these variables.
Windows Registry
1. Open the Windows Registry Editor (regedit.exe or reged32.exe)
2. Navigate to the appropriate Oracle Home
HKEY_LOCAL_MACHINE
SOFTWARE
Oracle
HEY_DevSuiteHome10g
3. FORMS_PATH: In the Key listing, scroll through and find the FORMS_PATH string variable and double-click or right-click and select Modify to edit the variable.
a. DO NOT delete the existing value. Add directory information by separating it with semicolons ;.
b. Example:
FORMS_PATH=C:\DevSuiteHome10g\cgenf61\admin;C:\Forms_Dev\*;
Note: I have found that I can include a wildcard reference in the FORMS_PATH. This allows me organize all of my Forms development into a
single directory. In my Forms_Dev directory, I have a Forms_Lib directory where I store all of my referenced items such as; attached libraries (.pll),
object libraries (.olb) and object referenced from a Forms Template file (template.fmb). Additionally, if I am working on different projects, I can
create a subdirectory for each project.
4. FORMS_BUILDER_CLASSPATH: find the existing entry for this key and open the key editor.
a. Again DO NOT delete any existing values
b. Add to the exiting directory and .jar file listing by separating each entry with a semicolon.
5. TNS_ADMIN: This entry does not exist, you will have to create this entry in each of the Oracle Homes.
a. In the key listing, right-click somewhere and New => String Value from the context menu
b. This will create an empty string entry.
c. Open the editor for the string and enter the full path to your TNS configuration files. Eg: C:\DevSuiteHome10g\NETWORK\Admin
DEFAULT.env
This file is used to set Forms runtime environment parameters. There are only two parameters that I have had to modify to enable running a form from the Forms Builder. They
are: FORMS_PATH and CLASSPATH.
The FORMS_PATH needs to have the same directories listed as stated above for the equivalent Registry or Environment variable.
The CLASSPATH only need to be modified if you implement a PJC or Java Bean in your form. You will need to list the full path, to include the file name, in this parameter
listing. This parameter has a maximum character length of 256 characters.
FORMSWEB.cfg
This file contains the parameter values used by the Forms Servlet. There are two types of parameters: SYSTEM and USER defined. System parameters are static in that they can not
be overridden at run time. User parameters have an entry in the baseHTML file and can be overridden in the URL query string.
This file is where the bulk of changes are needed the enable running a form from the Forms Builder. I will not list all of the parameters as there are too many. Refer to the Application
Server Forms Services Deployment Guide (see references) for a complete listing of all parameters and more detailed information.
Configuration will be separated by Java Runtime used. Ill list Sun JRE first and Jinitiator second. Bear in mind, that Oracle has retired the Jinitiator and no longer supports its use.
The formsweb.cfg is broke up into separate defined configurations. Each configuration is named and can be identified by the name in square brackets. For example, the Default
configuration is listed as: [default]. This is the configuration that is used unless it is overridden through the URL query string.
Ill list later in the document how you can override a User parameter or specify a custom configuration later in the document.
Conventions used:
Settings listed in Green are code comments
Settings listed in Blue are original settings
Settings listed in Red are recommend changes
Settings listed in Purple are optional changes
Sun JRE
Modify the following settings to use a JRE version different from the default if 1.4.2. The following JRE changes instruct the Forms Runtime to use the JRE version 1.6.0 update 22
(1.6.0_22). The following settings are all found in the [default] configuration section.
# System parameter: base HTML file for use with JInitiator client
# baseHTMLjinitiator=basejini.htm
baseHTMLjinitiator=basejpi.htm
Oracle Forms is hardwired (so to speak) to use the Oracle Jinitiator. Therefore, to instruct the Forms Runtime to use the JRE without passing a URL query string parameter, it is
recommended you change the baseHTMLinitiator parameter to point to the Java Plug-In (JPI) html file. You could also expand the existing [jpi] section and instruct the Forms
runtime to use this configuration in the URL. Personally, I find this to be the easier solution.
# Page displayed to users to allow them to download Sun's Java Plugin.
# Sun's Java Plugin is typically used for non-Windows clients.
# (NOTE: you should check this page and possibly change the settings)
# Original setting
#jpi_download_page=http://java.sun.com/products/archive/j2se/1.4.2_06/index.html
# New points to the generic ( non-version specific) JRE download web site
jpi_download_page=http://www.oracle.com/technetwork/java/javase/downloads/index.html
# Parameter related to the version of the Java Plugin
# Original setting
#jpi_classid=clsid:CAFEEFAC-0014-0002-0006-ABCDEFFEDCBA
# This setting is specific to JRE 1.6.0_22
jpi_classid=clsid:CAFEEFAC-0016-0000-0022-ABCDEFFEDCBA
# Optional Generic to any version of JRE 1.6.0.
Note the difference between these two settings.
jpi_classid=clsid:CAFEEFAC-0016-0000-FFFF-ABCDEFFEDCBA
# Parameter related to the version of the Java Plugin
# Original setting
#jpi_codebase=http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,06
# New specific to JRE 1.6.0_22
jpi_codebase=http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab#Version=1,6,0,22
# Optional Generic to JRE 1.6.0
jpi_codebase=http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab#Version=1,6,0
# Parameter related to the version of the Java Plugin
# Original Setting
#jpi_mimetype=application/x-java-applet;jpi-version=1.4.2_06
# New specific to JRE 1.6.0_22
jpi_mimetype=application/x-java-applet;jpi-version=1.6.0_22
# Optional Generic to JRE 1.6.0
jpi_mimetype=application/x-java-applet;jpi-version=1.6.0
Oracle Jinitiator
Modify the following settings to use a Jinitiator version different from the default if 1.3.1.26. There are no optional settings for Jinitiator.
# Page displayed to Netscape users to allow them to download Oracle JInitiator.
# Oracle JInitiator is used with Windows clients.
# If you create your own page, you should set this parameter to point to it.
# jinit_download_page=/forms/jinitiator/us/jinit_download.htm
# Parameter related to the version of JInitiator
jinit_classid=clsid:CAFECAFE-0013-0001-0026-ABCDEFABCDEF
jinit_classid=clsid:CAFECAFE-0013-0001-0028-ABCDEFABCDEF
# Parameter related to the version of JInitiator
# jinit_exename=jinit.exe#Version=1,3,1,26
jinit_exename=jinit.exe#Version=1,3,1,28
# Parameter related to the version of JInitiator
# jinit_mimetype=application/x-jinit-applet;version=1.3.1.26
jinit_mimetype=application/x-jinit-applet;version=1.3.1.28
Custom Configurations
If you have installed the Oracle Demos you will find that Oracle modifies the formsweb.cfg to add a configuration for each form included in the demo. While this works fine for
demos, it is a real pain in everyday development to add a configuration section for each form you work on (which is why I edit all of my forms in a directory that is in my
FORMS_PATH). However, there are times when it is good to create a configuration for a specific form. For example, if I want to run a form with the Forms Runtime Diagnostics
(FRD) enabled, I have created a configuration that enables this. Then I simply add the parameter to the url to enable FRD (?config=my_frd).
To create a custom configuration, open the formsweb.cfg file and scroll to the bottom of the file. Always add additionally configurations to the end of the file. Custom configurations
will use all of the variables in the [default] section and then override any you specify in your custom configuration. The following is based on my reference to use Forms Runtime
Diagnostics (FRD). The configuration listed below also uses a configuration specific environment file (default.env) as well.
[my_frd]
otherparams=record=collect log=my_frd.txt
envFile=my_frd.env
form=<YOUR_FORM_NAME_HERE.fmb>
To create a specific environment file, I simply copied the default.env to my_frd.env and added the following variable:
FORMS_TRACE_DIR=C:\DevSuiteHome10g\NETWORK\log
References:
- Oracle Application Server Forms Services Deployment Guide 10g Release 2(10.1.2) (B14032-03 Feb 2006)
- Oracle Application Server Certification Information - 10 g Release 2 (10.1.2) (B25703-62 - April 30, 2010)
- Using the Java Plug-in (JRE/JPI) with Oracle Forms (ID 794710.1)
- How Do the Jinitiator and JPI Parameters Work In a Forms Configuration (ID 444105.1)