Adsense Ad

Oracle Forms 12c: Configure WebUtil

 1) We know the Webutil is very powerful utility provided by Oracle 
     by using Webutil we can achieve so many things which help you in creating a very user-friendly

application 

2) The best part of Webutil I think the interaction with the client system.

when people were using 6i application then so many things can be achieved and it was simple to interact with the client system because it was a 2-tier application but when we talk about 12c forms and reports application so many people are confused that how we will achieve our requirements.

But using Webutil we can achieve all the requirements.

Webutil contains an inbuilt object library(webutil.olb) and a  Pl/SQL library(webutil.pll)  and a package webutil_DB which we have to create on the database.

3)   some of the uses of webutil are below

  • Getting the information from the client system like IP address, username, system name, OS type and much more.
  • Used in the transfer the file from the server to the client and vice-versa.
  • Reading the image from the client system.
  • We can write the file directly on the client machine.
  • It can be used in forms for excel file (.xls, .xlsx, .csv) export and import through the forms.
And much more. I have used this on various programs like auto weight machine integration with the forms, for webcam integrationsignature pad integration, using mac address for security, barcode printing, excel generation through forms etc...


4) Now the webutil can be configured in two ways.
* Normal configuration or we can say webutil without ole2.
* Webutil with ole2.

if we have requirement of ole2 then we will configure with ole2 else normal.
Ole2 invoke Microsoft application like excel word etc.... and write data on it using forms.
note:- In 12c we always prefer client_ole2 instead of ole2.

4-a)  webutil configuration without ole2 or Normal configuration.
steps to configure normal webutil

4-a1) To configure create the package WEBUTIL_DB.
this package is provided by the Oracle and you can find the package on forms directory of your oracle_home folder. create_webutil_db

The path for this pkg:-
D:\Oracle\Middleware\Oracle_Home\forms
In this folder, you will find the file named create_webutil_db.sql.
Open this file and copy the package and create the package in the database.

4-a2)  Change in webutil.cfg file.
         The path for webutil.cfg is
D:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\config\fmwconfig\components\FORMS\instances\forms1\server
in this folder you will see the file webutil.cfg

  • comment the below lines using # shown in the below image.   
  • Then enter the drive name on which you want to perform webutil operations.
  • Set TRUE on transfer.database.enabled, transfer.appsrv.enabled, transfer.appsrv.accesscontrol. 
  • See the below image for this.

Step 5) Then compile the webutil.pll and copy the .plx file on your execute folder(where you have .fmx files)
  • The path for webutil.pll is D:\Oracle\Middleware\Oracle_Home\forms 
  • Then copy the webutil.plx in your execute folder(where you have .fmx files)
      
Then restart the wls_forms and use the powerful utility the webutil.

4-a2) Configuring the webutil with ole2.

Do all the changes above mentioned.
To configure the webutil with ole2 firstly uncomment the below lines in webutil.cfg file by removing # from these lines.
we have commented these lines for normal configuration but for this, we have to uncomment these lines.
                         


Then do below steps:-

    • docs
    • jacob-1.18-M2-x64.dll
    • jacob-1.18-M2-x86.dll
    • jacob.jar
    • LICENSE.TXT
    • README.txt
  • copy Jacob-1.18-M2-x64.dll in D:\Oracle\Middleware\Oracle_Home\forms\webutil\win64
  • copy jacob-1.18-M2-x86.dll in D:\Oracle\Middleware\Oracle_Home\forms\webutil\win32
  • copy jacob.jar in D:\Oracle\Middleware\Oracle_Home\forms\java
  • copy all files from jacob-1.18-M2\Docs and paste in D:\Oracle\Middleware\Oracle_Home\forms\doc
  • Edit extensions.jnlp file, making the following change.
  • Path of extensions.Jnlp file is D:\Oracle\Middleware\Oracle_Home\forms\java
  • From this: <!-- <jar href="jacob.jar"/> -->
  • To this  : <jar href="jacob.jar"/>
  • Now we have to Sign the jar file
  • To sign the jar file we have to create the keysotre file.
  • To create keystore file open command prompt as administrator. 
  • Then go to the D:\Oracle\Middleware\Oracle_Home\oracle_common\jdk\bin
  • Use the below command to create the keystore file.

D:\Oracle\Middleware\Oracle_Home\oracle_common\jdk\bin>keytool.exe -genkey -alias myapp -keyalg RSA -keystore .keystore_myapp  -validity 3650     

  • Press Enter.
  • here .keystore_myapp is the name of our keystore file.
Then it will ask you for some parameter like.
Enter keystore password:
Re-enter new password:
What is your first and last name?
  [Unknown]:  Hasan Jawaid
What is the name of your organizational unit?
  [Unknown]:  Tech
What is the name of your organization?
  [Unknown]:  db-Ware Solutions
What is the name of your City or Locality?
  [Unknown]:  Karachi
What is the name of your State or Province?
  [Unknown]:  Sindh
What is the two-letter country code for this unit?
  [Unknown]:  PK
Is CN=hasan jawaid, OU=tech, O=dbware solutions, L=karachi, ST=Sindh, C=pk is correct?
  [no]:  yes

Enter key password for <myapp>
        (RETURN if same as keystore password):
Re-enter new password:

Enter the password and after 
give all the parameters as above mentioned.

A keystore file named .keystore_myapp will be created on the below directory 
D:\Oracle\Middleware\Oracle_Home\oracle_common\jdk\bin>

Then we will sign the jacob.jar using jarsigner

To sign the jacob.jar use below command on command prompt as administrator. 

Location of jarsigner.exe is D:\Oracle\Middleware\Oracle_Home\oracle_common\jdk\bin>
In the bin folder, you will able to see jarsigner.exe

the syntax for sign jacob.jar
jarsigner -keystore .keystore_myapp -storepass mypassword $ORACLE_HOME/forms/java/anyjarfile.jar myapp

The command to sign jacob.jar
D:\Oracle\Middleware\Oracle_Home\oracle_common\jdk\bin>jarsigner.exe -keystore .
keystore_myapp -storepass weblogic123 E:\Oracle\Middleware\Oracle_Home\forms\jav
a\jacob.jar myapp


It will show the below messages after running above command.

jar signed.

Warning:
The signer certificate will expire within six months.
No -tsa or -tsacert is provided and this jar is not timestamped. Without a times
tamp, users may not be able to validate this jar after the signer certificate's
expiration date (2018-12-06) or after any future revocation date.

Certificate:
Below command is used to export the certificate


D:\Oracle\Middleware\Oracle_Home\oracle_common\jdk\bin>keytool.exe -export -keystore .keystore_myapp -
alias myapp -file myapp.cer

Certificate will be generated at following location
D:\Oracle\Middleware\Oracle_Home\oracle_common\jdk\bin

Sometimes windows blocked the Keytool.exe of Oracle 12c JDK in this situation copy .keystore_myapp in installed java 1.8 jdk\bin folder and use java 1.8 Keytool.exe file to extract the certificate.

Add exported certificate in (Configure Java) = Java Control Panel> Security> Manage Certificates> Certificate type: (Signer CA)




After signing the jacob.jar  we have to change some lines on configuration files.

Add below bold lines in the default.env file in Class_path the location for default.env is

D:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_12.2.1\config


CLASSPATH=D:\Oracle\Middleware\Oracle_Home\jlib\frmbipc.jar;D:\Oracle\Middleware\Oracle_Home\forms\j2ee\frmsrv.jar;D:\Oracle\Middleware\Oracle_Home\forms\provision\frmconfig.jar;D:\Oracle\Middleware\Oracle_Home\jlib\ldapjclnt11.jar;D:\Oracle\Middleware\Oracle_Home\jlib\debugger.jar;D:\Oracle\Middleware\Oracle_Home\oracle_common\jlib\ewt3.jar;D:\Oracle\Middleware\Oracle_Home\oracle_common\modules\oracle.bali.share\share.jar;D:\Oracle\Middleware\Oracle_Home\jlib\utj.jar;D:\Oracle\Middleware\Oracle_Home\jlib\zrclient.jar;D:\Oracle\Middleware\Oracle_Home\reports\jlib\rwrun.jar;D:\Oracle\Middleware\Oracle_Home\forms\java\frmwebutil.jar;D:\Oracle\Middleware\Oracle_Home\forms\java\frmall.jar;D:\Oracle\Middleware\Oracle_Home\forms\java\jacob.jar;D:\Oracle\Middleware\Oracle_Home\oracle_common\jdk\jre\lib\rt.jar;



Then Change in formsweb.cfg to use webutil with client_ole2 or ole2.
The location of formsweb.cfg is D:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_12.2.1\config
In Oracle 12c Forms And Reports Application Configuration Steps, we have seen the named parameters we have used to configure the Application

Add- WebUtilArchive=frmwebutil.jar,jacob.jar in named configuration.


Now Restart the WLS_FORMS and run the application with ole2 functionality on forms.

AFTER DOING ALL THESE CHANGES WHEN YOU WILL RUN YOU APPLICATION IT MAY GIVE SOME ERROR OF JAVA SECURITY THE TO RESOLVE THIS ISSUE

Go on control Panel
click on java icon
click on security tab if the java console.
click on Edit site list.
Add the URL of your application on the client system.
Apply the changes.
And then run the application and enjoy the webutil with client_ole2 on your forms.


2 comments:

ABHISHEK JHA said...

please contact it's urgent.

mohsen said...
This comment has been removed by the author.