Friday, April 27, 2018

Enable BNE / WebADI debug trace

Instructions for BNE debug (in R12.1.3): 
1) Login to System Administrator Responsibility.
2) Open the System -> Profiles form.
3) Search for %BNE%LOG% in the profiles.
This will return three profiles:
BNE Debug Log Level -- This should be set to "TRACE" (default "ERROR". all caps)
BNE Debug Log Filename -- The log file name should be specified here (eg: "bne2018.log")
BNE Debug Log Directory - -The log file directory should be specified here.
NOTE: The log file should exist, even if empty. Application will not create a new file. Create an empty log file at the location specified in BNE Debug Log Directory like (eg: "bne2018.log"). A services recycle may be needed to make the changes effective.

Once login as System Administrator, paste below URL to same browser window to view details, including the log:
https://hostname.domain:portnumber/OA_HTML/BneAdminServlet

https://hostname.domain:portnumber/OA_HTML/BneAdminServlet?bne:action=log-first&bne:lines=10
https://hostname.domain:portnumber/OA_HTML/BneAdminServlet?bne:action=log-last&bne:lines=10

To reproduce an issue:
(a). Click the "clear-cache" link.
(b). For the attribute "log-set-level" (Current JVM only) , click on TRACE
(c). Run through reproducible case
(d). examine/upload the log

All BNE profile settings in my instance:
NAME
PROF_LEVEL
PROFILE_OPTION_VALUE
DESCRIPTION
BNE: ALLOW MAX DELIMITER
SITE
Y
To Allow maximum delimiter character to import text files in the integrator.
BNE Allow No Security Rule
SITE
N
Allow applications that have not defined a security rule to function
BNE Allow Set Parameters
SITE
Y
Controls access to the Upload Parameters window
BNE Allow Set Parameters
App:IGS
Y
Controls access to the Upload Parameters window
BNE Disable
NOT SET
NOT SET
Disables all Web ADI functionality
BNE Viewer Displays Image
SITE
Y
Excel Viewer does display default FND display image in WebADI documents created
BNE Document Lifetime
NOT SET
NOT SET
How long do documents live before they are automatically disabled.
BNE Enable Digital Signature
SITE
N
BNE Enforce Parameter Values
NOT SET
NOT SET
Sets whether a user can make an alternate value selection where the request parameter is not valid
BNE Offline List of Values Limit
NOT SET
NOT SET
Limit on the number of values to be downloaded for an offline List of Values
BNE Redirect Portal URL
NOT SET
NOT SET
URL of location Web ADI will redirect to.
BNE Debug Log Filename
SITE
bns2018.log
Name of the Web ADI log file.  If not set, file name is bne.log
BNE Debug Log Level
SITE
TRACE
Level of logging recorded in the Web ADI log file
BNE Debug Log Directory
SITE
/path/to/utl_dir
Directory for Web ADI log file on application server
BNE UIX Base Path
NOT SET
NOT SET
Web server path to the uix/cabo base.
BNE UIX Physical Directory
NOT SET
NOT SET
Physical directory that is mapped to BNE_UIX_BASE_PATH.
BNE Upload Batch Size
SITE
200
Number of uploaded rows in each batch sent from the middle tier to the database
BNE: Enable Upload Compression
NOT SET
NOT SET
Enable Upload Compression for the Instance
BNE Upload Staging Directory
SITE
/path/to/bne/upload
Physical file system directory for upload files
BNE Upload Text Directory
NOT SET
NOT SET
Physical file system directory for imported text files.
BNE Excel Worksheet Maximum
NOT SET
NOT SET
Allows users to set the maximum number of worksheets for a workbook
BNE XML Response Compression
NOT SET
NOT SET
Allows compression XML data

Tuesday, April 24, 2018

Patching to enable Java Web Start (JWS) for EBS R12.1.3

The purpose is to make EBS forms work with browsers on Windows 10 (win10). Before this task, my EBS instances work with Microsoft IE11 and JRE 1.8 only on Windows 7 client. The key Oracle document to follow is Using Java Web Start with Oracle E-Business Suite (Doc ID 2188898.1).

If s_forms_launch_method does exist in $CONTEXT_FILE, that means JWS is not enabled in the instance. Otherwise, it shall have:
$ grep s_forms_launch_method $CONTEXT_FILE
         <config_option type="techstack" oa_var="s_forms_launch_method">jws</config_option>

First of all, run query to see how many pre-patches are needed. Make sure first 6 patches were applied. If not, apply them first.  After all steps, all below 12 patches shall be installed.
select * from ad_bugs where bug_number in (
'9239090',  -- 12.1.3 Release Update Pack        (applied)
'22284589', -- R12.FWK.B.delta.5                    (applied with OCT17 CPU)
'17932167', -- R12.TXK.B.delta.3                     (applied with OCT17 CPU)
'24693065', -- R12.AD.B (Doc ID 2166227.1)  (applied with OCT17 CPU)
'8919491',  -- R12.ATG_PF.B.delta.3                (applied)
'7461070',  -- R12.AD.B.1 (pre-requisite for patch 23569686)  (applied)
'23569686', -- R12.AD.B.delta.8  (Doc ID 2166227.1)
'24498616', -- R12.AD.B  AD: Add Java Web Start support to EBS
'24319156', -- R12.TXK.B TXK: Add Java Web Start support to EBS
'25380324', -- R12.FND.B EBS Java Applets launching with Java Web Start 
'24709902', -- R12.OWF.B Workflow Java Applets launching with Java Web Start
'25140916'  -- R12.GL.B GL Account Hierarchy Manager
) order by creation_date desc
;


1. Backup file system, and copy/download patch .zip files to a same folder
2. Verify patch 26825525 was applied to 10.1.2 ORACLE_HOME.  If it not, apply it.
Notes: (a) after 26825525 was applied, patch 25441839 is not needed (and actually opatch will roll back 26825525 if you try to apply 25441839).
(b) It is part of October 2017 CPU and also part of January 2018 CPU patch.
(c) Its prerequisite patch: 14825718 ORACLE FORMS BUNDLE PATCH 10.1.2.3.2

$ echo $ORACLE_HOME
/path/to/apps/tech_st/10.1.2
$ vi /etc/oraInst.loc
to make sure it points to the right location
$ opatch lsinventory | grep 26825525
  1) Patch  26825525 applied on Mon Dec 11 12:59:06 EST 2017

3. Apply AD patch 23569686 R12.AD.B.delta.8
Confirmed with DBA that database patch 19393542 is not needed after OCT2018 PSU patch was applied.
$ adadmin  (to turn on Maintenance Mode)
$ unzip p23569686_R12.AD.B_R12_LINUX.zip
$ cd 23569686
$ ls
$ adpatch

Post Step: patch 23569686 has a post step (Doc ID 2166227.1)
$ adadmin => 3. Compile/Reload Applications Database Entities menu => 1. Compile APPS schema.
Type "No" when prompted for:
  Run Invoker Rights processing in incremental mode [No]

4. Apply AD patch 24498616 R12.AD.B
$ unzip p24498616_R12.AD.B_R12_GENERIC.zip
$ cd 24498616
$ ls
$ adpatch  (it runs very quick)

5. Merged 4 patches and then apply it (see Step 12 also)
24319156 R12.TXK.B
25380324 R12.FND.B
24709902 R12.OWF.B
25140916 R12.GL.B
Did NOT need below step in 12.1.0.2 database after OCT2017 PSU patch was applied:
   Additionally the following parameter need to be set to "true" before applying this patch
      "_plsql_conditional_compilation"=true ( refer note 338821.1)
     (From README of patch 25380324, 24709902, 25140916)

$ unzip win10_merge.zip
$ cd win10_merge
$ ls
$ adpatch

6. Apply JRE patch (to web tier).
Follow ID 393931.1 "Deploying JRE (Native Plug-in) for Windows Clients in Oracle E-Business Suite Release 12" to find the latest release. Download the 32-bit for MS Windows patch.
Patch 27638638 for 1.8.0_162. Or
Patch 26595878 for 1.8.0_152 (then, run below lines)
$ cp -p jre-8u152-windows-i586.exe $COMMON_TOP/webapps/oacore/util/jinitiator/j2se18152.exe
$ $FND_TOP/bin/txkSetPlugin.sh 18152

7. Enable JWS (Java Web Start)
$ vi $CONTEXT_FILE
 from <config_option type="techstack" oa_var="s_forms_launch_method">browser</config_option>
     to  <config_option type="techstack" oa_var="s_forms_launch_method">jws</config_option>

8. Fix bug 27138793 : UNABLE TO LAUNCH FORMS AFTER APLYING JWS RELATED PATCHES (to avoid ORA-28040: No matching authentication protocol from launching forms session)
Add following 4 lines to file $ORA_CONFIG_HOME/10.1.3/j2ee/forms/config/server.xml
        <shared-library name="oracle.jdbc" version="10.2.0.2" library-compatible="true">
                <code-source path="$COMMON_TOP/java/lib/jdbc6.zip"/>
                <code-source path="$COMMON_TOP/java/lib/orai18n.zip"/>
        </shared-library>
above the last line and replace $COMMON_TOP with real path. If it hits error, check file $LOG_HOME/ora/10.1.3/j2ee/forms/forms_default_group_1/server.log

To preserve that customization from overwritten by autoconfig:
 (a). Backup current server.xml file.
 (b). Create a folder called "custom" under $FND_TOP/admin/template where forms_server_xml_1013.tmp exists.
 (c). Copy forms_server_xml_1013.tmp to the custom folder. (copy and do not move)
 (d). Add 4 lines of code to file custom/forms_server_xml_1013.tmp

9. Run autoconfig (and verify customization was saved in server.xml).

10. Start services
$ adadmin (to disable maintenance mode)
$ ./adstrtal.sh apps/XXXXXX

11. EBS works in browsers (Google Chrome 63.0.3239.xxxx, Firefox 57.0.2, and Microsoft Edge 38.14393.xxx) on Windows 10, and also IE 11 on Windows 7 (with JRE 1.8.0_162 pre-installed) !
It matches results in Doc ID 2188898.1 Section 6: Browser User Experience and Configuration.

Troubleshooting:
- If it gives white forms with message Oracle Corporation Oracle Forms Java Webstart Oracle Forms Applet in popup window, one possible cause could be that frmsvr.jar file got corrupted and EAR file did not get deployed successfully. Check $LOG_HOME/appl/admin/log/adstrtal.log carefully.
- Some custom group policy in Windows may block downloading JWS frmservlet.jnlp.
- On a Windows 7 VM machine with JRE 1.6 installed, IE 11 failed to launch EBS forms. It gives a popup: Unable to launch the application
Error: The application has requested a version of the JRE (version 1.8+) that currently is not locally installed. Java Web Start is unable to automatically download and install the requested version.
JRE 1.8 must be installed on the machine before JWS forms fire up.

12. Depending on EBS modules used, more patches may be required in Step 5. I did not apply below patches.
SQL> select * from ad_bugs where bug_number in (
-- OPM
'22598196', -- R12.WMS.B.delta.14
'23256716', -- R12.OPM_PF.B.Delta.7 (Oracle Process Manufacturing)
'24833534', -- OPM: Bug fix. It needs above two as pre-requisites
--
'23280764',  -- IMC: Add JWS Support to Visualization UI Java applet
'23475123',  -- IES: Add JWS Support to Scripting Author Java applet
'23575933',  -- PON: Add JWS Support to Graph Price Java applet
'25075128',  -- CSI: Add JWS Support to Visualizer Java applet
'25106959'   -- MSC: Add Java Web Start Support to PS/SNO 12.1.3
);

NOTES:  Doc ID 389422.1 also lists all necessary patches for browsers. 10 patches exist in my instances:
select to_char(last_update_date,'dd-Mon-yyyy hh:mi:ss PM'), A.* from ad_bugs A where bug_number in (
'9239090',
'17932167',
'18936791',
'21565052',
'20986782',  -- No patch 20986782. It supersedes the previously recommended patch 19659562.
'19659562',  -- Patch 19659562 was applied in 2015 for IE11. Seems both are not necessary if CRM is not used.
'19486870',
'21482112',
'19273341',
'19559960',
'22284589'

order by creation_date desc;

NOTES:
Some users (not all users) could not save/download frmservlet.jnlp file to their PC and so could not open forms. We found that was due to corporate group policy settings on them and was not an EBS issue.

After EBS Forms worked with JWS for a couple of weeks, Forms popup window did not launch and gave error message in Chrome:
URL validation failed. The error could have been caused through the use of the browser's navigation buttons ( the browser Back button or refresh, for example). If the error persists, Please contact system administrator.
I see below message in $LOG_HOME/ora/10.1.3/j2ee/forms/forms_default_group_1/application.log, but I do not know what it means:
formsweb: oracle.apps.fnd.security.AppsFrmservletFilter.validateExtraParams:Ticket validation failed stored=null URLqs=-1631732614
After EBS services were bounced, this intermittent Forms problem did not show up. Oracle Support did not find what was the cause. I believe the cause could be unstable/interrupted database connection.

Patches applied for JWS will make EBS R12.1.3 not support multiple forms sessions from same instance on one desktop. Oracle says this is to address security vulnerability.

After JRE1.8 was installed, other applications may use it as well. For example, after JRE was upgraded from 1.8.0_241 to 1.8.0_261, Oracle SQL Developer got error Unable to launch the Java Virtual Machine Located at path: C:\Program Files(x86)\Java\jdk18\jre\bin\msvcr100.dll. The reason is JRE 1.8.0_261 does not ship msvcr100.dll due to change in Java Product strategy.  The workaround is to copy msvcr100.dll from C:\Windows\SysWOW64 to C:\Program Files (x86)\Java\jdk18\jre\bin folder.