Saturday, January 29, 2022

QR Code Tag-Length-Value (TLV) string into Base64 encoding for KSA E-Invoicing in Saudi Arabia Zakat Tax

Hello Everyone,

Link to Application -  https://apex.oracle.com/pls/apex/r/development_test01/tlv-base-64-qr/home?session=3169462546514

I have created a utility which can generate the QR code with TLV string encoded in base64 which is required for the E-Invoicing in Saudi Arab.

I got this requirement from one of my client from Kuwait. And they are using oracle forms 12c and 6i both versions and so many application and they wanted to print the QR code on invoice reports.

I had tried it with PLSQL but i didn't succeed. then i tried java because now the programming language is not a barrier for me. i just need the requirement and try to do it with the best suitable method.

That's it then i decided to help some more people for the same. as i seen so many peoples are seeking to get the information. that how they can implement this on there application.

In this blog,  i will share my understanding and the process which i followed to implement this.

--------------THE TLV FORMAT------------------------

As per Zakat, Tax and Customs Authority (ZATCA) of Saudi Arabia, one of the main requirements is the implementation of QR codes on tax invoices in the e-invoicing project (Fatoora), which will be mandatory starting December 4, 2021

As per the ZATCA instructions(Page No. 23), the minimum requirements that must be shown after scanning a QR code are the following fields, which should be represented in form of based64 encoding:

  1. Seller’s name.
  2. VAT registration number of the seller.
  3. Time stamp of the invoice (date and time).
  4. Invoice total (with VAT).
  5. VAT total.

In this blog,  I will show how to encode the QR data in base64 format using java code and then using it in any invoice to print QR code on Invoice layouts.

I am not going to provide the full code but yes i will give you the utility ( a jar file ) by which you will be able to convert normal data into tlv format then encode it in base64 and generate QR code directly with this single utility and in the output you will get a image file and you can use that image file to print it on any invoice system either the application to generate invoice can be in ORACLE FORMS, JAVA, .NET, APEX,ANGULAR and with any application.

1st Step is to prepare each of the five values in TLV (Tag-Length-Value) structure

Tag is fixed (1 for Seller’s name, 2 for VAT No……5 for VAT Total)

Length is the size of the value field in bytes (it’s not the count of characters but how many bytes the value represents)

Value is the data against each of the five fields.

Let’s take an example to clarify TLV

    1. Seller name; for example, “XYZ AAB
      • Tag      = 1 (1 as a type represents the seller name)
      • Length = 7 (The number of the bytes in “xyz AAB” word)
      • Value   = xyz AAB
    2. VAT Number; for example, 1234567891
      • Tag      = 2 (2 as a type represents the VAT number)
      • Length = 10
      • Value   = 1234567891
    3. Time Stamp; for example, 2021-11-18 08:40:00
      • Tag      = 3 (3 as a type represents invoice time stamp)
      • Length = 19
      • Value   = 2021-11-18 08:40:00
    4. Invoice Total; for example, 100.00
      • Tag      = 4 (4 as a type represents the invoice amount)
      • Length = 6
      • Value   = 100.00
    5. VAT Total; for example, 15.00
      • Tag      = 5 (5 as a type represents the tax amount)
      • Length = 5
      • Value   = 15.00

2nd Step is to convert ‘Tag’ and ‘Length’ to Hexadecimal and then to string. Then concatenate these two strings with ‘Value’ (stored as string)

concatenate all the five TLVs into one string

‘##XYZ AAB##1234567891##2021-11-18 08:40:00##115.00##15.00’

3rd Step is to convert the concatenated string to Base64 format

From the above example we get the following Base64 encoded value

AQxGaXJveiBBc2hyYWYCCjEyMzQ1Njc4OTEDEzIwMjEtMTEtMTcgMDg6MzA6MDAEBjExNS4wMAUFMTUuMDA=

4th Step is to generate the QR code of encoded string 

--------- UTILITY PART---------------------------

Development

*) written a java program to convert information in tlv format and encoding that information in base64.

*) written a java program to create QR Code image file from output string of first program.

*) downloaded and configured build path for java lib required for QR and tlv&base64 conversion.

*) combined both java programs in single code package.

*) Testing the whole logic as per KSA document standards for e-invoice.

*) created a jar file with variables for bundling all subprograms and libraries and required fields as input.

You can download this utility from below URL.

https://mega.nz/file/PW4Qna5T#kVm9gp8B7BHzbwaOHlqALoalb5EzqVVb3eZeyQfvo3Y

I named this utility as kdutility on the name of my daughters Kanak and Divya (KD).

How to use this utility to generate QR
-     Just create any directory. and place the jar utility and use below command to generate the QR code.


Open Command Prompt (cmd) for windows and terminal for  Unix/Linux.

Copy below highlighted Command and change the value for Seller_Name, Vat_Number, TimeStamp, InvoiceAmt, Vat_Amt and qr_dir ( qr_dir stands for the output directory in which you want the QR image file).

java -jar C:\Abhishek\projects\N_hdd\java_workspace2\kdutility.jar -Seller_Name "Abhishek Test" -Vat_Number 1234567891 -TimeStamp "2014-12-23 11:55:55" -InvoiceAmt 300.00 -Vat_Amt 75.00 -qr_dir C:\\Abhishek\\Oracle\\my_client\\RG_KSA_QR_TEST\\newqrcode.png

And That's it now you have the created QR image and ready to use for any invoice report.

note: - after every parameter there is a space between name of parameter and value of parameter.

And change the utility kdutility.jar path accordingly.

for example  -Seller_Name "Abhishek Jha"  - a Space before -Seller_Name and after -Seller_Name.


Example after Scanning and Output QR image for reference.


After Scanning this QR using below Android app

VAT App by the Zakat

Offered By: General Authority of Zakat and Tax-IT




Output - Screenshots 

                                                                In English Language



Output In Arabic Language



Benefits of having own utility.

*) As we are using java code so the utility is platform independent i.e., windows, Unix, Solaris etc...
*) And we can use the qr image to print on oracle reports, crystal reports etc...
*) we can also create a simple gui tool in forms ERP application to generate qr code on click event.
*) We can also replace third party utility or tools which we are currently in applications for QR codes with our own created utility by separating qr related code from our utility

*) if those third-party tools stop working and as we don't have their source code so it will impact the work. and in respect to this it will also reduce the dependency of any other third-party tools.


I can also share the source code of all above mentioned process on request or demand. 

I can also help you in implementing this functionality in your application. I did it for oracle forms 12c and 6i and printed the QR code on invoice reports.

You can also contact me for any other customization required in the utility or having issue in implementing the solutions.

 Abhishek Kumar - Abhishekjha1991@hotmail.com - only urgent.
                                  Abhishekjha225@gmail.com - for any other information.


EOD---------------------------------------------------------------- 

Buy Me a Coffee....Appreciate my work 

Phone Pay, Google Pay, Paytm etc.. - 9899406098

My Goal is to work full time on providing requested solutions and required programs code, software's etc.. and providing it to all programmers and companies in the world for free.  If you Appreciate my work then please buy me a coffee, if this utility is useful to you. And if you can't buy and still want to support me for my work Please share this page with your friends, family and coworkers if it is helpful to them.


References 
https://blogs.sap.com/2021/11/18/qr-code-in-base64-encoding-for-ksa-e-invoicing/
https://blogs.sap.com/2021/11/26/qr-code-in-base64-encoding-for-ksa-e-invoicing-directly-from-data-in-table-edosainv/
https://stackoverflow.com/questions/70346895/qr-code-in-base64-encoding-for-ksa-e-invoicing-in-java

Tuesday, November 16, 2021

Creating an OHS Instance and change default port by Using Fusion Middleware Control 12c

Creating an OHS Instance by Using Fusion Middleware Control 12c

You can create an Oracle HTTP Server instance in a WebLogic Server Domain by using Fusion Middleware Control installed as part of the Oracle Fusion Middleware infrastructure. Follow these steps.

  1. Log in to Fusion Middleware Control and navigate to the system component instance home page for the WebLogic Server Domain within which you want to create the Oracle HTTP Server instance.

  2. Open the WebLogic Server Domain menu and select Administration then Create/Delete OHS.




 

The OHS Instances page appears.



  1. Click Create.

The Create OHS Instance page appears.



  1. In Instance Name, enter a unique name for the Oracle HTTP Server instance; for example, ohs5.

  2. In Machine Name, click the drop-down control and select the machine to which you want to associate the instance.

  3. Click OK.

The OHS Instance page reappears, showing a confirmation message and the new instance. The port number is automatically assigned.

 

 

After creating the instance, the Column on the OHS Instances page shows a down-arrow for that instance.

Click on ohs5 

Start ohs5 to using start-up to use and if you want to change the port of newly created ohs as per the requirement of application see below


Editing Ports Using Fusion Middleware Control

You can edit the values for existing ports on the Fusion Middleware Control Edit Port page. To edit the ports using Fusion Middleware Control, do the following:

 

  1. Navigate to the Oracle HTTP Server home page.

  1. Select Administration from the Oracle HTTP Server menu.

  2. Select Ports Configuration from the Administration menu.

  3. Select the port for which you want to change the port number.

This is a port Oracle HTTP Server uses for its internal communication with Node Manager, in most of the cases it does not need to be changed. If you want to change it, manually edit the DOMAIN_HOME/config/fmwconfig/components/OHS/componentName/admin.conf file.

 

 

  1. Click Edit.



  1. Edit the Port number for the port.

  2. Click OK.

  3. Restart Oracle HTTP Server. 

Friday, October 8, 2021

How to Modify webutil.cfg in Forms 12C Using Fusion Middleware Control (FMWC)/EnterpriseManager(EM)

 In Forms 12c, as well as previous versions of Forms, Enterprise Manager(EM) - also called Fusion Middleware Control (FMWC) - should always be used to create/modify configuration files. It should be changed through the EM/FMWC console interface.

Note that you should use these tools, rather than directly editing configuration files, to perform all administrative tasks unless a specific procedure requires you to edit a file. Editing a file may cause the settings to be inconsistent and generate problems.

The option to edit webutil.cfg is available from the "Advanced Configuration" of FMWC. Choose "Miscellaneous" under the "SelectCategory" OPTION


ption.

Configure Icons in 12c forms reports application

 

HOW TO CONFIGURE  ICON IN 12C Forms Application

·       Make a directory icon in the java directory

·       Put all the gif icons in icon folder located in E:\Oracle\Middleware\Oracle_Home\forms\java\iCon

 

·       Then open Registry.dat from the below location. E:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\config\fmwconfi g\servers\WLS_FORMS\applications\formsapp_12.2.1\config\oracle\forms\registry\registry. dat

Insert the below lines in the registry.dat file 

 

default.icons.iconpath=//serverip:7777/forms/java/icon default.icons.iconextension=gif



 



 

Restart WLS_FORMS and run the application

ARABIC FONT CONFIGURATION FOR REPORTS 12C

 Arabic Characters do not Display Correctly in PDF Format using Arabic Transparent Font or Simplified Arabic font

For 12c Oracle reports 

Solution

The Arabic Transparent font does not have all Glyphs, so you need to replace artro.ttf and artrbdo.ttf with the Arial font.

 

PDF SUBSETTING IS NOT WORKING WITH SOME SPECIFIC ARABIC FONTS

 

 

Testcase with step-by-step instructions 

========================== 

  (Database used with NLS_LANG AR8MSWIN1256)

 

 

1. Make sure to set the environment variables for the Report Server in the windows registry.

  - Set REPORTS_PATH to the system font directory such as C:\Windows\Fonts

  - NLS_LANG=ARABIC_UNITED ARAB EMIRATES.AR8MSWIN1256

    OR

- NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256

 

2. Open uifont.ali under ORACLE_HOME\user_projects\domains\base_domain\config\fmwconfig\components\ReportsToolsComponent\RepTools1\guicommon\tk\adminset the font alias

   entries at [PDF:Subset] section.

.

 [ PDF:Subset ]

 

Arial..Italic.Bold.. = "Arialbi.ttf"

Arial..Italic... = "Ariali.ttf"

Arial...Bold.. = "Arialbd.ttf"

Arial..... = "Arial.ttf"

"Arabic Transparent"..Italic.Bold.. = "ARIALBI.TTF".....

"Arabic Transparent"..Italic... = "ARIALI.TTF".....

"Arabic Transparent"...Bold.. = "Arialbd.ttf"

"Arabic Transparent"..... = "artro.ttf"

 

Tahoma = "tahoma.ttf".....ar8mswin1256

Arial = "Tahoma"

"Tahoma Bold" = "tahomabd.ttf".

 

3. Copy uifont.ali in below location

Oracle_Home\user_projects\domains\base_domain\config\fmwconfig\components\ReportsToolsComponent\RepTools1\tools\COMMON

 

4. Restart WLS_REPORTS

 

5. Open report in builder and choose arial font on fields you want to show in Arabic and save it.

 

6. Run the report with an URL like:

 

http://localhost:9002/reports/rwservlet?server=rep_wls_reports_inproc+report=D:\projects\test_lang.rdf+userid=***/***@**+desformat=pdf+destype=cache       

 

Thursday, December 12, 2019

Install Oracle Forms & Reports 12c (Oracle Linux) Configure and Run Forms Application

 

Introduction

This post focuses on the creation, configuration and tuning of an initial Forms & Reports 12.2.1.2.0 Domain on the OEL 7.2 Server.

The following tasks will be implemented:

  • Preparing the Operating System for the installation of the WebLogic Server 12.2.1.2, Installation JDK 1.8 and the WebLogic Server 12.2.1.2:

  • Creating database schemas

  • Installing and Configuring a Forms & Reports Domain

  • Post-Installation Tasks:

    • Configuring of components

    • Creating of Start & Stop scripts for the automatic start/stop of components

  • Tuning and Troubleshooting

The Domain will be created on the one OEL 7.2 server: host03.example.com (IP 192.168.02.68)

Installation Forms & Reports 12.2.1.2

Prepare Software

Download and extract the following software from the Oracle Software Delivery Cloud: Forms & Reports 12.2.1.2.0

Installation Forms & Reports 12.2.1.2 (as OS User oracle)

Navigate to software directory, extract the software, set the environment and start the installation:

[oracle@host01 Oracle_Home]$ cd /u01/app/oracle/software/FMW/12.2.1.2.0/Forms_12.2.1.2

[oracle@host03]$ unzip V789399-01.zip

[oracle@host03]$ export JAVA_HOME=/u01/app/oracle/product/JAVA/jdk

[oracle@host03]$ export PATH=$JAVA_HOME/bin:$PATH

[oracle@host03]$ ./fmw_12.2.1.2.0_fr_linux64.bin

On the Welcome page click „Next“:

Enable „Skip Auto Updates“:

Set the Oracle Home to /u01/app/oracle/product/FMW/Oracle_Home:

Choose „Forms and Reports Deployment“:

Prerequisite Checks:

Verify the Summary of the Installation and click the button „Install“:

Verify installation…Next:

Check installed components and click „Finisch“:

The Installation Oracle Forms & Reports 12.2.1.2.0 is now completed

Create Database Schemas (as OS User oracle)

The database must be already created and prepared for the WebLogic Server Domain. The database must be running.

Login to the server as user oracle, navigate to oracle_common directory, and start the Repository Creation Utility (RCU):

[oracle@host03]$ cd /u01/app/oracle/product/FMW/Oracle_Home/oracle_common/bin

[oracle@host03]$ ./rcu

On the Welcome page: click „Next“:

For the new Oracle Forms and Reports Installation activate „Create Repository“ & „System Load and Production Load“:

Step 3: Database Connection Details: On this Page provide the database connection information:

Database Type: Oracle Database

Host Name (database host): host03.example.com

Port (Database Listener Port: 1521)

Service Name (Service Name of the repository database): orcl

Username & Password: Administration Account of the Database: sys/xxx

Role (Database Admin Role: SYSDBA or SYSOPER): SYSDBA

… „Next“:

The Installer checks the database connectivity:

Set the Prefix „TST“ for database schemas and select following components:

Oracle Platform Security Services

Audit Services

Audit Services Append

Click „Next“:

The installer will check database prerequisites:

Set the password for all database schemas:

On this page you can change settings for tablespaces… click on the button „Next“:

Tablespaces will be created:

Verify the Summary of the Installation and click the button „Create“:

Check the summary… „Close“:

The Forms and Reports Repository Creation is now completed

Create Domain (as OS User oracle)

Navigate to the oracle_common directory and start the Configuration Wizard:

[oracle@host03]$ cd /u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin

[oracle@host03]$ ./config.sh

Choose „Create a new Domain“ and set the „Domain Location“ to /u01/app/oracle/user_projects/domains/forms_domain:

On the next page select following components:

Specify an „Application Location“: /u01/app/oracle/user_projects/applications/forms_domain:

Set the Name and Password for the WebLogic Administrator:

Choose „Domain Mode“: Production and check the JDK location:

Configure the database details:

Specify the correct schema prefix: TST_STB and the information what were specified when you previously ran RCU (Chapter „Create Database Schemas“).

Then click on the Button „Get RCU Configuration“:

Installer checks database connectivity… „Next“:

Let default values and click „Next“

JDBC Test:

Activate check boxes for Administration Server, Node Manager, Topology and System Components for the advanced configuration:

Configure AdminServer: Let default values:

Configure the NodeManager:

Set Node Manager Type to „Per Domain Default Location“ – default

Enter Node Manager Credentials:

Username: nodemgr

Managed server

Listen Address

Port

Server Group

WLS_FORMS

192.168.75.35

9001

FORMS-MAN-SVR

WLS_REPORTS

192.168.75.35

9002

REPORTS-APP-SERVERS

On the page „Clusters“ let default values:

„Server Templates“ let default values:

„Dynamic Templates“: let default values:

„Assign Servers to Clusters“: let defaults:

„Coherence clusters“: let defaults:

Change the machine settings:

Name

Type

Listen Address

Port

UnixMachine_1

Unix Machine

192.168.75.35

5556

Add the AdminServer, WLS_FORMS and WLS_REPORTS to the Machine UNixMachine_1:

Don’t configure virtual targets:

Don’t configure partitions:

System Components:

System Component

Component Type

Restart Interval Seconds

Restart Delay Seconds

forms1

FORMS

3600

0

ohs1

OHS

3600

0

Configure System Component ohs1:

Admin Host: 192.168.75.35

Admin Port: 7779

Listen Address: 192.168.75.35

Listen Port: 7777

SSL Listen Port: 4443

Servername: http://192.168.75.35:7777

Assign System Components forms1 and ohs1 to the Machine UniyMachine_1:

Check the summary and click on „Create“:

After the creation of Domain click „Next“:

… and „Finish“:

The Creation of Forms & Reports Domain is now completed.

Post-Installation Tasks

Disabling the Derby Database

[oracle@host03]$ cd /u01/app/oracle/product/FMW/Oracle_Home/wlserver/common/derby/lib/


[oracle@host03]$ mv derby.jar disable_derby.jar

Initial Start / Shutdown the AdminServer

Start the AdminServer via script. Make sure the repository database and the listener are running!

Enter the values for the Administration User (weblogic) and passwort when prompted:

[oracle@host03]$ cd /u01/app/oracle/user_projects/domains/forms_domain/bin


[oracle@host03]$ ./startWebLogic.sh


Enter username to boot WebLogic server:weblogic


Enter password to boot WebLogic server:xxx

Shutdown the AdminServer via script:

[oracle@host03]$ cd /u01/app/oracle/user_projects/domains/forms_domain/bin


[oracle@host03]$ ./stopWebLogic.sh

Create the file boot.properties

[oracle@host03]$ cd /u01/app/oracle/user_projects/domains/forms_domain/servers/AdminServer

[oracle@host03]$ mkdir security

[oracle@host03]$ cd security/

[oracle@host03]$ echo -e "username=weblogic\npassword=welcome1" > boot.properties

[oracle@host03]$ cat boot.properties


username=weblogic

password=welcome1

NodeManager configuration

Edit file nodemanager.properties:

[oracle@host03]$ cd /u01/app/oracle/user_projects/domains/forms_domain/nodemanager

[oracle@host03]$ vi nodemanager.properties

Change parameter:

Old:

CrashRecoveryEnabled=false

New:

CrashRecoveryEnabled=true

Start NodeManager:

[oracle@host03]$ cd /u01/app/oracle/user_projects/domains/forms_domain/bin

[oracle@host03]$ nohup ./startNodeManager.sh &

Start AdminServer via NodeManager and WLST

Start wlst:

[oracle@host03]$ /u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin/wlst.sh

Connect to NodeManager:

wls:/offline> nmConnect('nodemgr','welcome1','host03.example.com','5556','forms_domain','/u01/app/oracle/user_projects/domains/forms_domain')

Start AdminServer:

wls:/nm/forms_domain> nmStart('AdminServer')

Start all Managed Servers via AdminConsole

Open the Browser and go to http://host03.exmple.com:7001/console

Starting all Managed Servers via Adminconsole:

All Managed Servers are running:

Reports Server Configuration

At first we must create ReportsToolsInstance (via wlst)

Start wlst:

[oracle@host03]$ /u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin/wlst.sh

Connect to the AdminServer (the AdminServer and WLS_REPORTS must be running):

wlst> connect('weblogic','welcome1', 't3://host03.example.com:7001')

Create the reports server instance:

wls:/forms_domain/serverConfig/> createReportsToolsInstance(instanceName='reptools1',machine='UnixMachine_1')

Enable Reports Webaccess:

Edit the File rwservlet.prpoerties:

vi /u01/app/oracle/user_projects/domains/forms_domain/config/fmwconfig/servers/WLS_REPORTS/applications/reports_12.2.1/configuration/rwservlet.properties

Add the Line (red):

<?xml version="1.0" encoding="UTF-8"?>

<rwservlet xmlns="http://xmlns.oracle.com/reports/rwservlet" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

   <server>rep_wls_reports_host03</server>

   <singlesignon>no</singlesignon>

   <inprocess>yes</inprocess>

   <webcommandaccess>L2</webcommandaccess>

</rwservlet>

Restart the Managed Server WLS_REPORTS

Create the stand alone reports server: my_rersrv

Start wlst:

[oracle@host03]$ /u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin/wlst.sh

Connect to the AdminServer (the AdminServer and WLS_REPORTS must be running):

wlst> connect('weblogic','welcome1', 't3://host03.example.com:7001')

Create ReportsServerInstance:

wls:/forms_domain/serverConfig/> createReportsServerInstance(instanceName='my_repsrv',machine='UnixMachine_1')

Disable the Single Sign On for the Reports Server:

Edit the File rwserver.properties:

vi /u01/app/oracle/user_projects/domains/forms_domain/config/fmwconfig/components/ReportsServerComponent/my_repsrv/rwserver.conf

Change the Line:

  <!--job jobType="report" engineId="rwEng" securityId="rwJaznSec"/-->

To:

<job jobType="report" engineId="rwEng"/>

Start the standalone reports server and save the NodeManager Password:

cd /u01/app/oracle/user_projects/domains/forms_domain/bin


./startComponent.sh my_repsrv storeUserConfig

You will be prompted to try the nodemanager user password:

Please enter Node Manager password: xxx

Problem: by starting of the reports server we received the error message:

Error: Error occurred while performing nmStart : Error Starting server my_repsrv : Received error message from Node Manager Server: [Server start command for ReportsServerComponent server ‚my_repsrv‘ failed due to: [Server failed to start up but Node Manager was not aware of the reason]. Please check Node Manager log and/or server ‚my_repsrv‘ log for detailed information.]. Please check Node Manager log for details.

The Logfile my_repsrv.out contains the following messages:

/u01/app/oracle/product/FMW/Oracle_Home/bin/rwserver: error while loading shared libraries: libXm.so.3: cannot open shared object file: No such file or directory)

The Solution is in the MOS Note „Reports Builder / Server Fails to Start in 12c With “ libXm.so.3: cannot open shared object file: No such file or directory“ Only on Linux 7 (Doc ID 2073755.1)“described:

Changes:

New installation on Linux OEL7 or RedHat7.

Cause:

This version of the motif library (libXm.so.3) is not available on OEL7 or RedHat7.

Solution:

The workaround is to create a symbolic link between the new motif library and the old one.

ln -s /usr/lib64/libXm.so.4.0.4 /usr/lib64/libXm.so.3

Try as root:

[root@host03 ~]# ln -s /usr/lib64/libXm.so.4.0.4 /usr/lib64/libXm.so.3

Restart all Components: NodeManager, AdminServer, Managed Server WLS_FORMS, Managed Server WLS_REPORTS

Start the reports server as oracle:

cd /u01/app/oracle/user_projects/domains/forms_domain/bin

./startComponent.sh my_repsrv storeUserConfig

Output:

Successfully Connected to Node Manager.

Starting server my_repsrv ...


Successfully started server my_repsrv ...

Successfully disconnected from Node Manager.

Check the Reports Server (Browser):

http://host03.example.com:9002/reports/rwservlet/showenv?server=my_repsrv

Configuring Forms and Reports for the using HTTP Server

The HTTP Server must be started once, for the directories associated with „ohs1“ instance to be created

Start OHS via NodeManager and WLST

Start wlst:

/u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin/wlst.sh

Connect to NodeManager:

wlst> nmConnect('nodemgr','welcome1','host03.example.com','5556','forms_domain','/u01/app/oracle/user_projects/domains/forms_domain')

Start OHS Component:

wls:/nm/forms_domain> nmStart(serverName='ohs1', serverType='OHS')

Output:

Starting server ohs1 ...

Successfully started server ohs1 ...

Edit the Forms Configuration: the forms.conf file:

vi /u01/app/oracle/product/FMW/Oracle_Home/forms/templates/config/forms.conf

Add following lines:

 <Location /forms>

     SetHandler weblogic-handler

     WebLogicHost host03.example.com

     WeblogicPort 9001

</Location>

Edit Reports Configuration: the reports_ohs.conf file:

vi /u01/app/oracle/product/FMW/Oracle_Home/reports/conf/reports_ohs.conf

Add following lines:

<Location /reports>

     SetHandler weblogic-handler

     WebLogicHost host03.example.com

     WeblogicPort 9002

</Location>

Copy forms.conf and reports_ohs.conf to the directory OHS_INSTANCE_HOME/moduleconf:

cp /u01/app/oracle/product/FMW/Oracle_Home/forms/templates/config/forms.conf \

/u01/app/oracle/user_projects/domains/forms_domain/config/fmwconfig/components/OHS/instances/ohs1/moduleconf


cp /u01/app/oracle/product/FMW/Oracle_Home/reports/conf/reports_ohs.conf \

/u01/app/oracle/user_projects/domains/forms_domain/config/fmwconfig/components/OHS/instances/ohs1/moduleconf

Restart OHS Server Component:

Start wlst:

/u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin/wlst.sh

Connect to NodeManager:

wlst> nmConnect('nodemgr','welcome1','host03.example.com','5556','forms_domain','/u01/app/oracle/user_projects/domains/forms_domain')

Restart OHS Component:

wls:/nm/forms_domain> nmKill(serverName='ohs1', serverType='OHS')

wls:/nm/forms_domain> nmStart(serverName='ohs1', serverType='OHS')

Check Installation:

Check the WebLogic Admin Console via Browser: http://host03.example.com:7001/console:

Check the Enterprise Manager via Browser: http://host03.example.com:7001/em:

Check OHS via Browser: http://host03:7777:

Check Forms Base URL via Browser: http://host03.example.com:9001/forms/frmservlet:

Check Forms via Base HTTP URL (Browser): http://host03.example.com:7777/forms/frmservlet:

Check Reports Base URL via Browser: http://host03.example.com:9002/reports/rwservlet:

Check Reports via Base HTTP URL (Browser): http://host03.example.com:7777/reports/rwservlet:

Check Stand Alone Reports Server my_repsrv via URL (Browser):

Managed Server Port: http://host03.example.com:9002/reports/rwservlet/showenv?server=my_repsrv

HTTP Server Port: http://host03.example.com:7777/reports/rwservlet/showenv?server=my_repsrv

Where are configuration files stored?

Forms

File

Path

formsweb.cfg

/config/fmwconfig/servers/WLS_FORMS/applications/formsapp_12.2.1/config

default.env

/config/fmwconfig/servers/WLS_FORMS/applications/formsapp_12.2.1/config

Templates

/config/fmwconfig/components/FORMS/instances/forms1/server

registry.dat

/config/fmwconfig/servers/WLS_FORMS/applications/formsapp_12.2.1/config/oracle/forms/registry

ftrace.cfg

/config/fmwconfig/components/FORMS/instances/forms1/server

webutil.cfg

/config/fmwconfig/components/FORMS/instances/forms1/server

Reports:

File

Path

rwserver.conf

/config/fmwconfig/servers/WLS_REPORTS/applications/reports_12.2.1/configuration

rwnetwork.conf

/config/fmwconfig/servers/WLS_REPORTS/applications/reports_12.2.1/configuration

rwservlet.properties

/config/fmwconfig/servers/WLS_REPORTS/applications/reports_12.2.1/configuration

Reports Instances Configuration Directories: Example for the Reports server my_repsrv:

/config/fmwconfig/components/ReportsServerComponent/my_repsrv

Tuning and Troubleshooting Oracle Forms and Reports

Tuning JVM

We will customize the settings for the Java Heap size and for WebLogic Server Start parameters by the creating the File setUserOverrrides.sh.

We will tune the Java heap size for the Admin Server and for each Managed Server.

We will set some WebLogic Server start Parameter:

  • -Dweblogic.MaxMessageSize=300000000    # increase the MessageSize

  • -Dweblogic.threadpool.MinPoolSize=1024    # Tuning the WebLogic ThreadPool

For more information about the customizing of Java settings please refer to my article How to customize Java Virtual Machine Settings in Oracle WebLogic Server 12 on OS Linux / UNIX

Create file UserOverrides.sh:

cd /u01/app/oracle/user_projects/domains/forms_domain/bin

cat setUserOverrides.sh (an Example):

#!/bin/bash


echo "Setting from UserOverrides.sh"

# global settinga (for all servers)s

export JAVA_OPTIONS="$JAVA_OPTIONS -Dweblogic.MaxMessageSize=300000000"

export USER_MEM_ARGS="-Xms256m -Xmx512m"


# customer settings for each server

if [ "${SERVER_NAME}" = "AdminServer" ]

then

  echo "Customizing USER_MEM_ARGS for SERVER_NAME ${SERVER_NAME}"

  export USER_MEM_ARGS="-Xms1024m -Xmx1536m"

fi


if [ "${SERVER_NAME}" = "WLS_FORMS" ]

then

  echo "Customizing USER_MEM_ARGS for SERVER_NAME ${SERVER_NAME}"

  export USER_MEM_ARGS="-Xms2g -Xmx2g -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:NewSize=1g"

  export JAVA_OPTIONS="$JAVA_OPTIONS -Djava.awt.headless=true"

fi


if [ "${SERVER_NAME}" = "WLS_REPORTS" ]

then

  echo "Customizing USER_MEM_ARGS for SERVER_NAME ${SERVER_NAME}"

  export USER_MEM_ARGS="-Xms2g -Xmx2g -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:NewSize=1g"

  export JAVA_OPTIONS="$JAVA_OPTIONS -Djava.awt.headless=true"

fi


echo "End setting from UserOverrides.sh"

Restart the AdminServer, all Managed Server and OHS:

Start wlst:

/u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin/wlst.sh

Connect to NodeManager:

nmConnect('nodemgr','welcome1','host03.example.com','5556','forms_domain','/u01/app/oracle/user_projects/domains/forms_domain')

Stop all components:

wls:/nm/forms_domain> nmKill('WLS_FORMS')

wls:/nm/forms_domain> nmKill('WLS_REPORTS')

wls:/nm/forms_domain> nmKill(serverName='ohs1', serverType='OHS')

wls:/nm/forms_domain> nmKill('AdminServer')

Start all components:

wls:/nm/forms_domain> nmStart('AdminServer')

wls:/nm/forms_domain> nmStart(serverName='ohs1', serverType='OHS')

wls:/nm/forms_domain> nmStart('WLS_REPORTS')

wls:/nm/forms_domain> nmStart('WLS_FORMS')

Tuning Fusion Middleware Control (as OS User oracle)

Reference: MOS Note „How to Enable Discovery Cache To Avoid Long Delay During Login To Fusion Middleware Control (Doc ID 1423893.1)“

Start wlst and connect to the AdminServer (the AdminServer must be running):

/u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin/wlst.sh

wls:/offline> connect('weblogic','welcome1','t3://host03.example.com:7001')

Change location to domain custom tree

wls:/forms_domain/serverConfig/> domainCustom()

Setting variables:

wls:/forms_domain/domainCustom/> myMBean=ObjectName('emoms.props:Location=AdminServer,name=emoms.properties,type=Properties,Application=em')

wls:/forms_domain/domainCustom/> types=['java.lang.String', 'java.lang.String']

wls:/forms_domain/domainCustom/> type=['java.lang.String']

Set property oracle.sysman.emas.discovery.wls.FMW_DISCOVERY_USE_CACHED_RESULTS=true:

wls:/forms_domain/domainCustom/> params=['oracle.sysman.emas.discovery.wls.FMW_DISCOVERY_USE_CACHED_RESULTS', 'true']

wls:/forms_domain/domainCustom/> mbs.invoke(myMBean,'setProperty',params,types)

Set property oracle.sysman.emas.discovery.wls.FMW_DISCOVERY_MAX_CACHE_AGE=7200000:

wls:/forms_domain/domainCustom/> params=['oracle.sysman.emas.discovery.wls.FMW_DISCOVERY_MAX_CACHE_AGE','7200000']

wls:/forms_domain/domainCustom/> mbs.invoke(myMBean,'setProperty',params,types)

Set property oracle.sysman.emas.discovery.wls.FMW_DISCOVERY_MAX_WAIT_TIME=10000:

wls:/forms_domain/domainCustom/> params=['oracle.sysman.emas.discovery.wls.FMW_DISCOVERY_MAX_WAIT_TIME','10000']

wls:/forms_domain/domainCustom/> mbs.invoke(myMBean,'setProperty',params,types)

Invoke getProperty operations to display and confirm parameter values (Values returned by wlst are in bold):

Display changes added:

wls:/forms_domain/domainCustom/> param=['oracle.sysman.emas.discovery.wls.FMW_DISCOVERY_USE_CACHED_RESULTS']

wls:/forms_domain/domainCustom/> mbs.invoke(myMBean,'getProperty',param,type)

'true'


wls:/forms_domain/domainCustom/> param=['oracle.sysman.emas.discovery.wls.FMW_DISCOVERY_MAX_CACHE_AGE']

wls:/forms_domain/domainCustom/> mbs.invoke(myMBean,'getProperty',param,type)

'7200000'


wls:/forms_domain/domainCustom/> param=['oracle.sysman.emas.discovery.wls.FMW_DISCOVERY_MAX_WAIT_TIME']

wls:/forms_domain/domainCustom/> mbs.invoke(myMBean,'getProperty',param,type)

'10000'

Start & Stop of Components

Order by starting:

1.    NodeManager

2.    AdminServer

3.    All Managed Servers

4.    Reports Servers

5.    OHS

Order by shutting down:

1.    OHS

2.    Reports Servers

3.    All Managed Servers

4.    AdminServer

5.    NodeManager

Start / Stop NodeManager

Start:

export DOMAIN_HOME=/u01/app/oracle/user_projects/domains/forms_domain

nohup ${DOMAIN_HOME}/bin/startNodeManager.sh > ${DOMAIN_HOME}/nodemanager.out 2>&1 &

Stop:

export DOMAIN_HOME=/u01/app/oracle/user_projects/domains/forms_domain

${DOMAIN_HOME}/bin/stopNodeManager.sh

Start / Stop Oracle HTTP Server

Start / Stop via script (requirement: the NodeManager must be running):

export DOMAIN_HOME=/u01/app/oracle/user_projects/domains/forms_domain

$DOMAIN_HOME/bin/startComponent.sh ohs1

$DOMAIN_HOME/bin/stopComponent.sh ohs1

Start / Stop via wlst (Note: the NodeManager must be running):

Start wlst:

/u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin/wlst.sh

Connect to NodeManager:

nmConnect('nodemgr','welcome1','host03.example.com','5556','forms_domain','/u01/app/oracle/user_projects/domains/forms_domain')

Start / Stop OHS via wlst:

nmStart(serverName='ohs1', serverType='OHS')

nmKill(serverName='ohs1', serverType='OHS')

Start / Stop the AdminServer

Start / Stop AdminServer via script:

Start:

export DOMAIN_HOME=/u01/app/oracle/user_projects/domains/forms_domain

${DOMAIN_HOME}/bin/startWebLogic.sh

Stop:

export DOMAIN_HOME=/u01/app/oracle/user_projects/domains/forms_domain

${DOMAIN_HOME}/bin/stopWebLogic.sh

Start / Stop AdminServer via wlst and NodeManager (Note: the NodeManager must be running):

Start wlst:

/u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin/wlst.sh

Connect to NodeManager:

nmConnect('nodemgr','welcome1','host03.example.com','5556','forms_domain','/u01/app/oracle/user_projects/domains/forms_domain')

Start / Stop AdminServer:

wlst> nmStart('AdminServer')

wlst> nmKill('AdminServer')

Start / Stop Managed Servers:

Start / Stop via script:

Start:

export DOMAIN_HOME=/u01/app/oracle/user_projects/domains/forms_domain

${DOMAIN_HOME}/bin/startManagedWebLogic.sh WLS_FORMS

${DOMAIN_HOME}/bin/startManagedWebLogic.sh WLS_REPORTS

Stop:

export DOMAIN_HOME=/u01/app/oracle/user_projects/domains/forms_domain

${DOMAIN_HOME}/bin/stopManagedWebLogic.sh WLS_FORMS

${DOMAIN_HOME}/bin/stopManagedWebLogic.sh WLS_REPORTS

Start / Stop all Managed Servers via wlst and NodeManager (Note: the NodeManager must be running):

Start wlst:

/u01/app/oracle/product/FMW/Oracle_Home/oracle_common/common/bin/wlst.sh

Connect to NodeManager:

nmConnect('nodemgr','welcome1','host03.example.com','5556','forms_domain','/u01/app/oracle/user_projects/domains/forms_domain')

Start / Stop all Managed Servers:

wlst> nmStart('WLS_FORMS')

wlst> nmStart('WLS_REPORTS')


wlst> nmKill('WLS_REPORTS')

wlst> nmKill('WLS_FORMS')

Start / Stop Report Server (Note: NodeManager and MS WLS_REPORTS must be running):

Start:

export DOMAIN_HOME=/u01/app/oracle/user_projects/domains/forms_domain

${DOMAIN_HOME}/bin/startComponent.sh my_repsrv

Stop:

export DOMAIN_HOME=/u01/app/oracle/user_projects/domains/forms_domain

${DOMAIN_HOME}/bin/stopComponent.sh my_repsrv

Start / Stop In-Process Reports Server via Browser:

Start:

http://host03.example.com:9002/reports/rwservlet/startserver

Stop:

http://host03.example.com:9002/reports/rwservlet/stopserver

Forms Web Start via Browser:

Start via Managed Server Port:

http://host03.example.com:9001/forms/frmservlet?config=webstart

Start via HTTP Server Port:

http:// host03.example.com:7777/forms/frmservlet?config=webstart

QR Code Tag-Length-Value (TLV) string into Base64 encoding for KSA E-Invoicing in Saudi Arabia Zakat Tax

Hello Everyone, Link to Application -   https://apex.oracle.com/pls/apex/r/development_test01/tlv-base-64-qr/home?session=3169462546514 I ha...