The integration of XML Publisher within Concurrent Processing is done by means of a specialized concurrent manager called the Output Post Processor (OPP). If a request is submitted which has an XML Publisher template specified as a layout for the output, then after the concurrent manager finishes running the concurrent program, it will contact the OPP to apply the XML Publisher template and create the final output.
An overview of the actions involved:
1. An application user submits an XML Publisher based report.
2. The standard concurrent manager processes the request.
3. The XML data file is generated by the standard concurrent manager. This can be done by various methods:
o Oracle Reports - Report Definition File (RDF)
o XML Publisher Data Template - XML data template linked to the Data Definition
o Any other process that produces XML output
4. A post processing action defines that the output needs to be generated by the Output Post Processor hence it is triggered by the standard manager.
5. The Output Post Processor generates the final report and informs the standard concurrent manager whether that was successful.
6. The standard concurrent manager finalizes the concurrent request.
Processes in OPP:
There should always be at least one OPP process active in the system. If no OPP service is available to process concurrent requests, completed requests that require OPP post-processing will complete with a status of Warning.
One service instance of the OPP service is seeded by default. This seeded OPP service instance has one workshift with one process.
A concurrent manager contacts an available OPP process when a running concurrent request needs an OPP post-processing action. Concurrent managers use a local OPP process (on the same node) by default, but will choose a remote OPP if no local OPP process is available.
Threads in OPP:
The OPP Service is multi-threaded and will start a new thread for each concurrent request it processes. You can control the number of simultaneous threads for an OPP Service Instance by adjusting the Threads per Process parameter for the instance.
If all the OPP process has reached their respective maximum number of threads, the requests waiting to be processed remain in a queue to be processed as soon as threads become available. If request throughput has become slow, you may want to increase the number of Threads per Process for the OPP.
The number of concurrent requests that the Output Post Processor can handle in parallel depends upon:
· the number of Processes
· the number of Threads Per Process
The default values are 2 Processes and 5 Threads per Process so a total of 10 reports can be processed in parallel.
Issues with OPP:
1. Timeout issue with OPP:
Example:
There is 1 OPP process with 2 threads. Hence 4 reports can be processed at any time.
- In case there are other concurrent requests running which have already invoked the OPP then it might happen that no additional requests can be picked up for a period of time. The pending request will be picked up as soon as one of the running jobs completes.
By default a timeout will occur if it takes longer than 120 seconds (2 min.) for the Output Post Processor to pick up the request from the concurrent manager process. In that case, the concurrent request will complete with status Warning.
-Once the Output Post Processor picks up the request, the BI Publisher engine is invoked to generate the final output file. The time that this takes will depends on various elements such as:
· size of the XML Data File
· complexity of the template
· performance of the server
By default a timeout will occur if it takes longer than 300 seconds (5 min.) for the BI Publisher engine to generate the output file. The concurrent request will complete with status Warning
Solution:
There are 2 new profiles options that can be used to control the timeouts.
Profile Option : Concurrent:OPP Response Timeout
Internal Name : CONC_PP_RESPONSE_TIMEOUT
Description : Specifies the amount of time a manager waits for OPP to respond to its request for post processing.
Profile Option : Concurrent:OPP Process Timeout
Internal Name : CONC_PP_PROCESS_TIMEOUT
Description : Specifies the amount of time the manager waits for the OPP to actually process the request.
The value for the above profile options can be increased to avoid timeouts.
The number of processes/threads for OPP can also be increased; however the concurrent manager has to be restarted for the changes to take effect.
2. Output Post Processing Fails Due To java.lang.ThreadDeath
-Increase the value of the Concurrent:OPP Timeout profile option to 10800 seconds.
-Enable the scalability feature of XML Publisher:
a. Login as SYSADMIN
b. Responsibility: XML Publisher Administrator
c. Function: Administration
d. Set the following properties:
e. Temporary Directory
f. Use XML Publisher's XSLT processor: True
g. Enable scalable feature of XSLT processor: True
h. Enable XSLT runtime optimization: True
- Restart the Concurrent Managers so that changes take effect
3. Output Post Processor is Down with Actual Process is 0 And Target Process is 1
This can happen on a cloned instance.
- FNDSVC should exist under FND_TOP/bin
- Bring down all application services and relink the FNDSVC through adadmin or using the below command:
adrelink.sh force=y ranlib=y "FND FNDSVC"
- Restart all applications services and restest the issue.
4. Output Post Processor (OPP) Log Contains Error "java.lang.OutOfMemoryError: Java heap space
- Determine what the heap size per OPP process is currently:
select DEVELOPER_PARAMETERS from FND_CP_SERVICES
where SERVICE_ID = (select MANAGER_TYPE from FND_CONCURRENT_QUEUES
where CONCURRENT_QUEUE_NAME = 'FNDCPOPP');
- The default should be:
J:oracle.apps.fnd.cp.gsf.GSMServiceController: -mx512m
- Increase the Heap Space per Process to 1024:
update FND_CP_SERVICES
set DEVELOPER_PARAMETERS =
'J:oracle.apps.fnd.cp.gsf.GSMServiceController:-mx1024m'
where SERVICE_ID = (select MANAGER_TYPE from FND_CONCURRENT_QUEUES
where CONCURRENT_QUEUE_NAME = 'FNDCPOPP');
- Bring the Concurrent managers down.
-Run cmclean.sql script from Note 134007.1 - CMCLEAN.SQL Non-Destructive Script to Clean Concurrent Manager Tables.
-Bring the managers up again.
OR
-Log into applications with the System Administrator responsibility.
- Navigate to Concurrent -> Program -> Define
-Query the XML Publisher Template Re-Generator program
-Set the following value for the Executable Options: -Xmx1024m
- Save changes.
- Retest the program.
Reference: Oracle Metalink
1. Stop all middle tier services including the concurrent managers.
2. Stop the database.
3. Start the database.
4. Connect SQLPLUS as APPS user and run the following :
EXEC FND_CONC_CLONE.SETUP_CLEAN;
COMMIT;
EXIT;
5. Run AutoConfig on all tiers, firstly on the DB tier and then the APPS tiers and webtiers to repopulate the required system tables.
6. Connect to SQLPLUS as APPS user and run the following statement :
select CONCURRENT_QUEUE_NAME from FND_CONCURRENT_QUEUES where CONCURRENT_QUEUE_NAME like 'FNDSM%';
If the above SQL does not returning any value then please do the following:
Go to $FND_TOP/patch/115/sql
Connect SQLPLUS as APPS user and run the following script :
SQL> @afdcm037.sql;
(Note : The same "afdcm037.sql" is used for Release 12 also ).
This script will create libraries for FNDSM and create managers for preexisting nodes.
Check again that FNDSM entries now exist:
select CONCURRENT_QUEUE_NAME from FND_CONCURRENT_QUEUES where CONCURRENT_QUEUE_NAME like 'FNDSM%';
7. Go to cd $FND_TOP/bin
$ adrelink.sh force=y "fnd FNDLIBR"
$ adrelink.sh force=y "fnd FNDSM"
$ adrelink.sh force=y "fnd FNDFS"
$ adrelink.sh force=y "fnd FNDCRM"
8. Run the CMCLEAN.SQL script from the referenced note below (don't forget to commit).
REM
REM FILENAME
REM cmclean.sql
REM DESCRIPTION
REM Clean out the concurrent manager tables
REM NOTES
REM Usage: sqlplus <apps_user/apps_passwd> @cmclean
REM
REM
REM +======================================================================+
set verify off;
set head off;
set timing off
set pagesize 1000
column manager format a20 heading 'Manager short name'
column pid heading 'Process id'
column pscode format a12 heading 'Status code'
column ccode format a12 heading 'Control code'
column request heading 'Request ID'
column pcode format a6 heading 'Phase'
column scode format a6 heading 'Status'
WHENEVER SQLERROR EXIT ROLLBACK;
DOCUMENT
WARNING : Do not run this script without explicit instructions
from Oracle Support
*** Make sure that the managers are shut down ***
*** before running this script ***
*** If the concurrent managers are NOT shut down, ***
*** exit this script now !! ***
#
accept answer prompt 'If you wish to continue type the word ''dual'': '
set feed off
select null from &answer;
set feed on
REM Update process status codes to TERMINATED
prompt
prompt ------------------------------------------------------------------------
prompt -- Updating invalid process status codes in FND_CONCURRENT_PROCESSES
set feedback off
set head on
break on manager
SELECT concurrent_queue_name manager,
concurrent_process_id pid,
process_status_code pscode
FROM fnd_concurrent_queues fcq, fnd_concurrent_processes fcp
WHERE process_status_code not in ('K', 'S')
AND fcq.concurrent_queue_id = fcp.concurrent_queue_id
AND fcq.application_id = fcp.queue_application_id;
set head off
set feedback on
UPDATE fnd_concurrent_processes
SET process_status_code = 'K'
WHERE process_status_code not in ('K', 'S');
REM Set all managers to 0 processes
prompt
prompt ------------------------------------------------------------------------
prompt -- Updating running processes in FND_CONCURRENT_QUEUES
prompt -- Setting running_processes = 0 and max_processes = 0 for all managers
UPDATE fnd_concurrent_queues
SET running_processes = 0, max_processes = 0;
REM Reset control codes
prompt
prompt ------------------------------------------------------------------------
prompt -- Updating invalid control_codes in FND_CONCURRENT_QUEUES
set feedback off
set head on
SELECT concurrent_queue_name manager,
control_code ccode
FROM fnd_concurrent_queues
WHERE control_code not in ('E', 'R', 'X')
AND control_code IS NOT NULL;
set feedback on
set head off
UPDATE fnd_concurrent_queues
SET control_code = NULL
WHERE control_code not in ('E', 'R', 'X')
AND control_code IS NOT NULL;
REM Also null out target_node for all managers
UPDATE fnd_concurrent_queues
SET target_node = null;
REM Set all 'Terminating' requests to Completed/Error
REM Also set Running requests to completed, since the managers are down
prompt
prompt ------------------------------------------------------------------------
prompt -- Updating any Running or Terminating requests to Completed/Error
set feedback off
set head on
SELECT request_id request,
phase_code pcode,
status_code scode
FROM fnd_concurrent_requests
WHERE status_code = 'T' OR phase_code = 'R'
ORDER BY request_id;
set feedback on
set head off
UPDATE fnd_concurrent_requests
SET phase_code = 'C', status_code = 'E'
WHERE status_code ='T' OR phase_code = 'R';
REM Set all Runalone flags to 'N'
REM This has to be done differently for Release 10
prompt
prompt ------------------------------------------------------------------------
prompt -- Updating any Runalone flags to 'N'
prompt
set serveroutput on
set feedback off
declare
c pls_integer := dbms_sql.open_cursor;
upd_rows pls_integer;
vers varchar2(50);
tbl varchar2(50);
col varchar2(50);
statement varchar2(255);
begin
select substr(release_name, 1, 2)
into vers
from fnd_product_groups;
if vers >= 11 then
tbl := 'fnd_conflicts_domain';
col := 'runalone_flag';
else
tbl := 'fnd_concurrent_conflict_sets';
col := 'run_alone_flag';
end if;
statement := 'update ' || tbl || ' set ' || col || '=''N'' where ' || col || ' = ''Y''';
dbms_sql.parse(c, statement, dbms_sql.native);
upd_rows := dbms_sql.execute(c);
dbms_sql.close_cursor(c);
dbms_output.put_line('Updated ' || upd_rows || ' rows of ' || col || ' in ' || tbl || ' to ''N''');
end;
/
prompt
prompt ------------------------------------------------------------------------
prompt Updates complete.
prompt Type commit now to commit these updates, or rollback to cancel.
prompt ------------------------------------------------------------------------
prompt
set feedback on
REM <= Last REM statment -----------------------------------------------------
9. Start the middle tier services including your concurrent manager.
10. Retest the issue .