You are on page 1of 7

Steps Of 10g Webutil

Steps Of 10g Webutil

plz copy webutil object library and pll in forms folder of oracle developer home directory.

Webutil Steps
=========================
1. On drive C create a folder name Webutil.
Extract the jacob_18.zip file into C:\Webutil_Final Folder.

2. Switch to Command Prompt, and perform following:


C:\>cd webutil
C:\>cd webutil_final
C:\Webutil_Final>COPY JACOB.JAR D:\oracle\DevSuiteHome_1\forms\java
C:\Webutil_Final>COPY JACOB.DLL D:\oracle\DevSuiteHome_1\forms\webutil
C:\Webutil_Final>COPY calendar90.pll D:\oracle\DevSuiteHome_1\forms
C:\Webutil_Final>COPY stndrd20.OLB D:\oracle\DevSuiteHome_1\forms

3. On Dos Prompt Sign frmwebutil.jar and jacob.jar with following commands


C:\>set path=D:\oracle\DevSuiteHome_1\jdk\bin;%PATH%

Sign the files by using


C:\>D:\oracle\DevSuiteHome_1\forms\webutil\sign_webutil
D:\oracle\DevSuiteHome_1\forms\java\frmwebutil.jar

Output
Generating a self signing certificate for key=webutil2...
...successfully done.

.
Backing up D:\oracle\DevSuiteHome_1\forms\java\frmwebutil.jar as D:\oracle\DevSu
iteHome_1\forms\java\frmwebutil.jar.old...
1 file(s) copied.
Signing D:\oracle\DevSuiteHome_1\forms\java\frmwebutil.jar using key=webutil2...
...successfully done.

C:\>D:\oracle\DevSuiteHome_1\forms\webutil\sign_webutil
D:\oracle\DevSuiteHome_1\forms\java\jacob.jar

Output
Generating a self signing certificate for key=webutil2...
keytool error: java.lang.Exception: Key pair not generated, alias already exists
.
There were warnings or errors while generating a self signing certificate. Please review them.
.
Backing up D:\oracle\DevSuiteHome_1\forms\java\jacob.jar as
D:\oracle\DevSuiteHome_1\forms\java\jacob.jar.old...
1 file(s) copied.
Signing D:\oracle\DevSuiteHome_1\forms\java\jacob.jar using key=webutil2...
...successfully done.
--On Application Server
--Generate Keystore :
D:\>%ORACLE_HOME%\jdk\bin\keytool -genkey -alias myapp -keyalg RSA -keystore
.keystore_myapp
E:\oracleas10g\FRHOME1\jdk\bin\keytool -genkey -alias myapp2 -keyalg RSA -keystore
.keystore_myapp2

--Export Certificate of the Keystore :


D:\>%ORACLE_HOME%\jdk\bin\keytool -export -alias myapp2 -keystore
.keystore_myapp2 -rfc -file svm.cert

--Sign Jar File :


D:\>%ORACLE_HOME%\jdk\bin\jarsigner -keystore .keystore_myapp2 -
storepassmyapp123D:\oracle\app\oracle\product\12.2.1\forms\java\jacob.jar myapp2

4. Now open the SQL Session connecting with SYS user, and create a user named WEBUTIL
and Password is ORACLE.
SQL>CREATE USER WEBUTIL IDENTIFIED BY oracle DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP;

User created.

SQL>GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO


WEBUTIL;

Grant succeeded.

SQL>CONN WEBUTIL/ORACLE
Connected.
USER is "WEBUTIL"
linesize 100
pagesize 100
long 80
SQL> @D:\Webutil_Final\create_webutil_db.sql

Package created.

Package body created.


SQL>CREATE or replace PUBLIC SYNONYM WEBUTIL_DB FOR
WEBUTIL.WEBUTIL_DB;

Synonym created.
SQL> CONN SYS/ORACLE AS SYSDBA
Connected.

SQL>GRANT EXECUTE ON WEBUTIL_DB TO PUBLIC;

Grant succeeded.

5.Modify the DEFAULT.ENV file, you can find default.env file at


D:\oracle\DevSuiteHome_1\forms\server\Default.env
append the following path in CLASSPATH entry
;d:\oracle\DevSuiteHome_1\jdk\jre\lib\rt.jar
append the following path in FORMS_PATH
;D:\oracle\DevSuiteHome_1\forms\webutil

6.Modify the FORMSWEB.CFG file, you can find this file at


D:\oracle\DevSuiteHome_1\forms\server\formsweb.cfg
add:
archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar
archive=frmall.jar
also add :
[webutil]
WebUtilArchive=frmwebutil.jar,jacob.jar,f90all.jar
WebUtilLogging=off
WebUtilLoggingDetail=normal
WebUtilErrorMode=Alert
WebUtilDispatchMonitorInterval=5
WebUtilTrustInternal=true
WebUtilMaxTransferSize=16384
baseHTMLjinitiator=webutiljini.htm
baseHTMLjpi=webutiljpi.htm
archive_jini=frmall_jinit.jar
archive=frmall.jar,f90all.jar
lookAndFeel=oracle
7.Modify the WEBUTIL.CFG file locate at the same place where you found the
FORMSWEB.CFG file and change the
following
#transfer.database.enabled=FALSE (default value)
transfer.database.enabled=TRUE
#transfer.appsrv.enabled=FALSE (default value)
transfer.appsrv.enabled=TRUE

8. Logon scott user in sqlplusw.


SQL> DESC EMP
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)

SQL> CREATE TABLE EMP_IMAGE


2 (EMPNO NUMBER(04) PRIMARY KEY REFERENCES EMP(EMPNO),
3* IMAGE BLOB);

Table created.

SQL> INSERT INTO EMP_IMAGE


2 (EMPNO)
3* SELECT EMPNO FROM EMP;

SQL> COMMIT;
Commit complete.

9. Start OC4J instance,Open the Form Builder, and connect with WEBUTIL/ORACLE@orcl,
Open the WEBUTIL.PLL file, located at
D:\oracle\DevSuiteHome_1\forms folder, compile all (Shift+Control+K), and genearte to PLX.
Then Open the WEBUTIL.OLB, and
Subclass object to the form. Now attache the webutil.pll library and remove the path.

10.Create a new form module as Master&Detail using EMP and EMP_IMAGE data block.
After completing the wizard switch to Object naviagtor->Object Library->Open Webutil.olb
which are located on
D:\oracle\DevSuiteHome_1\forms folder. Subclass the following, which are located in object
library
WEBUTILCONFIG into Parameter Node.
WEBUTIL into Object Group Node.

11. Now attached the Pl Library WEBUTIL.PLL file, located at


D:\oracle\DevSuiteHome_1\forms folder, and Press Yes button
when message appeared after pressing attach button.
PUSH_BUTTON1 PUSH_BUTTON2
NAME GET_FILE_NAME UPLOAD_DB

12. Now create One Text item, and Two Push buttons on WEBUTIL data block, and choose the
Canvas where EMP Block are shown.

13. Apply following codes.

At form level
==================
WHEN NEW FORM INSTANCE
declare
fake_timer TIMER;
begin
-- Purpose of the fake timer is the we cannot call webutil in this trigger since the
-- beans have not yet been instantiated. If we put the code in a when-timer-expired-trigger
-- it means that this timer will not start running until Forms has focus (and so the webutil
-- beans will be instantiated and so call canbe made.
fake_timer:= CREATE_TIMER('webutil',100,NO_REPEAT);
end;
WHEN TIMER EXPIRED
:global.user_home := webutil_clientinfo.get_system_property('user.home');

At Program Unit Node


=====================
PROCEDURE UPLOAD_DB IS
l_successboolean;
BEGIN
l_success := webutil_file_transfer.Client_To_DB_with_progress
(clientFile => :file_name
,tableName => 'EMP_IMAGE'
,columnName => 'IMAGE'
,whereClause => 'EMPNO ='||:EMP.EMPNO
,progressTitle => 'Upload to Database in progress'
,progressSubTitle=> 'Please wait'
,asynchronous => false
,callbackTrigger => null
);
if l_success then
message('File uploaded successfully into the Database');
else
message('File upload to Database failed'||SQLERRM);
end if;
exception
when others then
message('File upload failed: '||sqlerrm);
END;

When Button Pressed Trigger


============================
On GET_FILE_NAME Push Button
declare
l_filename varchar2(200);
begin
l_filename := client_get_file_name(directory_name => :global.user_home
,file_name => null
,file_filter => null
,message => null
,dialog_type => null
,select_file => null
);
:file_name := l_filename;
end;

On UPLOAD_DB Push Button


begin
upload_db;
exception
when others then
message('File upload failed: '||sqlerrm);

end;

14.Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if the


"Application Server URL" is empty.Then append "?config=webutil" at the end, so you end up
with a URL of the form http://server:port/forms/frmservlet?config=webutil
--On Application Server

--Generate Keystore :

D:\>%ORACLE_HOME%\jdk\bin\keytool -genkey -alias myapp -keyalg RSA -keystore .keystore_myapp

D:\>%ORACLE_HOME%\jdk\bin\keytool -genkey -alias myapp -keyalg RSA -keystore .keystore_myapp

E:\oracleas10g\FRHOME1\jdk\bin\keytool -genkey -alias myapp -keyalg RSA -keystore .keystore_myapp

--Export Certificate of the Keystore :

E:\DevSuiteHome_1\jdk\bin \keytool -export -alias myapp -keystore .keystore_myapp -rfc -file svm.cert
--Sign Jar File :

E:\DevSuiteHome_1\jdk\bin \jarsigner -keystore .keystore_myapp -


storepassmyapp123E:\DevSuiteHome_1\forms\java\jacob.jar myapp

How To By-Pass Java Security Warnings for Forms 11g

Oct 8, 2012

IMPORTANT: To bypass any Java security warning message, it is strongly recommended


to sign all custom jar files (all of the jar files beginning with “frm” are already signed by
Oracle and should NOT be updated in any way) with trusted X.509 certificates. Having all
jar files signed with trusted certificates will eliminate the Java security warnings as well as
to keep your PC and server safe from any security vulnerabilities. The below article is for
knowledge purposes only and should NOT be used in production environments or any PCs
which have access to the Internet. PITSS will not be held responsible for malware that may
enter your PC or server when applying the below JRE security settings; use at your own
risk!

The main issue and largest question from customers is why do they get the following warning-
prompt-box:

Firstly, this issue can be completely bypassed by importing the certificate that the customer’s jar
files were signed with into the end-client’s JRE trusted certificates file (“trusted.certs”). No Java
Warning Prompt will occur once the certificate is loaded into the JRE. Steps on how to do this
are below. However doing this requires a customer’s system admin team to be involved, so they
can modify every one of their end-client’s JRE’s. Thus, the second recommendation.

Secondly, there will be times when an end-client can’t have their JRE loaded with the proper
settings without manual interaction. Thus actually clicking through the prompt. However, if the
any jar files are not signed with a X.509 Certificate, JRE’s default action is to cancel running the
jar file, thus interrupt Forms’ ability to run properly. Therefore, it is recommend to sign all jar
files with an X.509 Certificate, so that if this warning does occur, the user can be assured, that
the jar file has been signed with a certificate that is verified by a major Certificate Authority.

How to Configure JRE Security

1. Retrieve Certificate File. If the customer is using X.509, the security or system admin will know
where this is. Once you have the file continue on to step 3. If you deployed jar files with a self-
signed certificate, continue onto step 2.
2. (Conditional step) Complete this step only if you sign your jar files with a self-signed certificate.
o Login to your application server where Forms runs.
o Open a command-line tool
o Verify your JDK’s bin directory path is in your PATH environment variable.
o Navigate to where your keystore is. If you don’t know where the certificate is and you
use sign_webutil.bat/sh, the location of the keystore will be in the sign_webutil script.
When looking in sign_webutil, retrieve your alias and keystore password as well.
o Run the following command to export the certificate from the keystore:
keytool -export -alias KeystoreAliasName -file NewCertificateFileName.crt -
keystoreNameOfKeystore.jks
o The command above will export your certificate to a certificate file.
3. Login to a end-client-machine that you wish to configure. Locate your “trusted.certs” file of your
JRE.
o For example, on Win 7, with username johndoe, the path would be
C:\Users\johndoe\AppData\LocalLow\Sun\Java\Deployment\security\trusted.certs
o On Windows XP, with username johndoe, the path would be C:\Documents and
Settings\johndoe\Application Data\Sun\Java\Deployment\security (NOTE: If security
does not exist, the cache directory can also be used)
o NOTE: The AppData/Application Data directory is hidden. You may need to type it in the
taskbar on the top of Windows Explorer.
4. Copy the certificate to the filesystem on the client-machine
5. Open Command line on the client-machine
6. Navigate to the directory where the certificate is loaded.
7. Load Certificate into the JRE Trusted Certificates Store. See the following command example to
load the certificate into your JRE’s trusted certificate store:
o Windows 7: keytool -importcert -file CertificateFileName.crt -keystore
C:\Users\johndoe\AppData\LocalLow\Sun\Java\Deployment\security\trusted.certs -
storepass “” -noprompt -v
o Windows XP: keytool -import -file CertificateFileName.crt -keystore “C:\Documents and
Settings\johndoe\Application Data\Sun\Java\Deployment\security\trusted.certs” -
storepass “” -noprompt -v
8. The command above should load in the certificate successfully.
9. Test your changes.

You might also like