How to configure J2EE (OC4J) to serve Oracle Forms to a Web Browser

Oracle9iDS comes with a lightweight OC4J that seems to be OK for at least 10 concurrent users. However, Oracle recommend that this is only used for test and demonstration purposes and that customers should use Oracle9iAS (R2) for production (if they require support that is).

This recipe assumes that :
. An Oracle 9iAS R2 infrastructure has already been installed and configured.
. An Oracle 9iAS Forms and Business Intelligence module has been installed and configured

Note that Oracle9iAS requires seperate installations and therefore seperate ORACLE_HOMEs for the infrastructure and Forms module.

Install Forms, Icons and Java Beans

Install the Forms, Forms images and java classes onto the web server

$ORACLE_HOME/forms90/gsk

*.fmb *.fmx *.pll files
(Forms source, executables and libraries)

$ORACLE_HOME/forms90/image

*.gif files
( graphics for Forms icons )

$ORACLE_HOME/forms90/java/oracle/forms

*.class files
(JavaBeans in Forms)


Configure Web Forms To Show Icons

Map the virtual images directory to the directory where the images are stored on the web server. Forms6i and earlier uses icons (.ico) files for buttons. Forms9i only uses .gif or .jpg files

# cd /opt/oracle/product/9.0.2

 

For Oracle9iDS:

# vi /opt/oracle/product/9.0.2/j2ee/Oracle9iDS
     /application-deployments/forms/forms90web/orion-web.xml

Add the following line to the virtual directory mappings section:

<virtual-directory virtual-path="/image" real-path="/opt/oracle/product/9.0.2/forms90/image" />

# vi /opt/oracle/product/9.0.2/forms90/java
     /oracle/forms/registry/Registry.dat

default.icons.iconpath=image/
default.icons.iconextension=gif

Stop and start the 9iDS OC4J process:

$ $ORACLE_HOME/j2ee/Oracle9iDS/stopinst.sh
$ $ORACLE_HOME/j2ee/Oracle9iDS/startinst.sh

 

For Oracle9iAS R2:

# vi /opt/oracle/product/9.0.2/forms90/server/forms90.conf

Add the following line to the virtual directory mappings section:

# Virtual path for ICONS (used to show icons in a form)
AliasMatch ^/forms90/image/(..*) "/opt/oracle/product/9.0.2/forms90/image/$1"


# vi /opt/oracle/product/9.0.2/forms90/java/
     oracle/forms/registry/Registry.dat

default.icons.iconpath=http://ukcradm1.gsk.com:7779/forms90/image
default.icons.iconextension=gif

Use the Enterprise Manager Website to stop and start the OC4J_BI_Forms Instance and HTTP Server Instance. This is usually accessible on port 1810 on the application server.

 

Configure Forms Server To Find Java Beans and Containers

# vi forms90/server/default.env

FORMS90_TIMEOUT=180
FORMS90_PATH=/opt/oracle/product/9.0.2iDS/forms90;
    /opt/oracle/product/9.0.2iDS/forms90/gsk


Configure Forms to use Java Beans. Add the following entry at the end of the existing CLASSPATH definition:

/opt/oracle/product/9.0.2/forms90/java/f90all.jar

Set the Forms default runtime parameters. Add a section for each Forms application to the formsweb.cfg file

# vi forms90/server/formsweb.cfg

#
# GSK forms
#
[gsk]
buffer_records=NO
debug_messages=NO
array=YES
query_only=NO
quiet=NO
RENDER=YES


Increase the OC4J client timeout period:

For 9iDS:
# vi /opt/oracle/product/9.0.2/forms90/j2ee/forms90app
/forms90web/WEB-INF/web.xml

For 9iAS R2:
# vi /opt/oracle/product/9.0.2/j2ee/OC4J_BI_Forms
/applications/forms90app/forms90web/WEB-INF/web.xml

<session-config>
    <!-- Session timeout in minutes -->
    <session-timeout>180</session-timeout>
</session-config>


Add an entry to the TNSNAMES.ORA file for the Forms ORACLE_HOME installation:

# vi /opt/oracle/product/9.0.2/network/admin/tnsnames.ora

ORCL92 =
   (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ukcradm1)(PORT = 1521))
   )
   (CONNECT_DATA =
      (SERVICE_NAME = ORCL92)
   )

Test the forms and OC4J install. Enter the following URL in your browser window:

http://ukcradm1:7779/forms90/f90servlet?form=test.fmx

The following will appear if all is well:

 

Test the forms are being served correctly and that icons appear. Enter the following URL in your browser window:

http://ukcradm1:7779/forms90/f90servlet?form=test.fmx &config=GSK

Fuente:

http://www.oracleadvice.com/Tips/oc4j.htm