Search: For:
Browsing Single Category

activating Workflow Mailer Service GET: ClassDefFoundError: oracle/apps/pass/profiles/Profiles

Topic ID: 1191
Created By: 2006-OCT-10 12:41:43 [Vitaliy]
Updated By: 2008-JUN-05 03:36:53 [Acotunoaei]
Status: New
Severity: Normal
Read Only: No
4443
2006-OCT-10 12:41:43
Moderator
 
 
Registered On: Mar 2006
Total Posts: 194
ISSUE:

   After 115102 upgrade Workflow Mailer Service | Workflow Agent Listener Service | Workflow Document Web Services Service DO NOT STARTUP

Steps to reproduce:

1. configure WF mailer as per Note:268085.1
2. Activate WF Concurrent processing

Concurrent : Manager -> Administer
Workflow Agent Listener Service
Workflow Mailer Service
Workflow Document Web Services Service
Activate all of them


##
## Verify that workflow mailer and agent listener services running successfully 
## without exceptions in the log files. [they are not]
##

dbtier.applmgr->ls -l $APPLCSF/$APPLLOG/FNDCPGSC*.txt
-rw-r--r--   1 applmgr  oaa          359 Mar  8 17:08 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199414.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:08 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199415.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:08 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199416.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:08 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199417.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:08 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199418.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:08 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199419.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:08 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199420.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:09 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199421.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:09 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199422.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:11 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199423.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:11 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199424.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:13 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199425.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:13 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199426.txt
-rw-r--r--   1 applmgr  oaa         1270 Mar  8 17:15 /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199427.txt

##
## Here's the error that was reported in one of the log files
## after I Activated WF% cm queues
##
dbtier.applmgr->more /u02/app/applmgr/common_cm/log/BHUP_dbtier/FNDCPGSC199415.txt
LOG_ID_UNKNOWN : oracle.apps.fnd.cp.gsc.Logger.Logger(String, int) : Logging to System.out until necessary parameters are retrieved for Logger to be properly started.
LOG_ID_UNKNOWN : oracle.apps.fnd.cp.gsm.GSMSvcComponentContainer.initializeStateMachine() : BEGIN
LOG_ID_UNKNOWN : oracle.apps.fnd.cp.gsc.SvcComponentContainer.getNewWorkflowContext() : BEGIN
LOG_ID_UNKNOWN : oracle.apps.fnd.cp.gsc.SvcComponentContainer.getNewWorkflowContext() : BEGIN
Could not start Service Component Container because an unexpected RuntimeException or other Throwable occurred -> java.lang.No
ClassDefFoundError: oracle/apps/pass/profiles/Profiles
java.lang.NoClassDefFoundError: oracle/apps/pass/profiles/Profiles
        at oracle.apps.fnd.profiles.ExtendedProfileStore.clear(Compiled Code)
        at oracle.apps.fnd.security.SessionManager.setUser(Compiled Code)
        at oracle.apps.fnd.security.SessionManager.setUser(Compiled Code)
        at oracle.apps.fnd.wf.apps.ContextFactory.makeContext(Compiled Code)
        at oracle.apps.fnd.wf.common.WorkflowContext.<init>(Compiled Code)
        at oracle.apps.fnd.cp.gsc.SvcComponentContainer.getNewWorkflowContext(Compiled Code)
        at oracle.apps.fnd.cp.gsc.SvcComponentContainer.start(Compiled Code)
        at oracle.apps.fnd.cp.gsm.GSMSvcComponentContainer.main(Compiled Code)

dbtier.applmgr->echo $AF_CLASSPATH
/u02/app/applmgr/common/util/jre/1.1.8/lib/rt.jar:/u02/app/applmgr/common/util/jre/1.1.8/lib/i18n.jar:/u02/app/applmgr/common/java/appsborg.zip:/u02/app/applmgr/common/java/apps.zip:/u02/app/applmgr/product/8.0.6_115102/forms60/java:/u02/app/applmgr/common/java


dbtier.applmgr->grep jar $APPL_TOP/admin/adjborg2.txt
/u02/app/applmgr/product/iAS_115102/jlib/jssl-1_1.jar
/u02/app/applmgr/product/iAS_115102/jlib/javax-ssl-1_1.jar
/u02/app/applmgr/product/iAS_115102/rdbms/jlib/aqapi.jar
/u02/app/applmgr/product/iAS_115102/rdbms/jlib/jmscommon.jar
/u02/app/applmgr/product/iAS_115102/Apache/xsu/xsu12.jar
/u02/app/applmgr/product/iAS_115102/Apache/xsu/oraclexmlsql.jar
/u02/app/applmgr/product/iAS_115102/rdbms/jlib/xsu12.jar
/u02/app/applmgr/product/iAS_115102/lib/http_client.jar
/u02/app/applmgr/product/iAS_115102/dm/lib/odmapi.jar
/u02/app/applmgr/product/iAS_115102/soap/webapps/soap/WEB-INF/lib/soap.jar


dbtier.applmgr->unzip -l $JAVA_TOP/appsborg2.zip | grep -i jms | wc -l
     128

dbtier.applmgr->grep jar $APPL_TOP/admin/adjborg.txt
/u02/app/applmgr/product/8.0.6_115102/owm/jlib/jssl-1_1.jar
/u02/app/applmgr/product/8.0.6_115102/owm/jlib/javax-ssl-1_1.jar
/u02/app/applmgr/product/iAS_115102/dm/lib/odmapi.jar
dbtier.applmgr->

## this setting is coming from:
$APPL_TOP/admin/adovars.env

AF_CLASSPATH="/u02/app/applmgr/common/util/jre/1.1.8/lib/rt.jar:/u02/app/applmgr/common/util/jre/1.1.8/lib/i18n.jar:/u02/app/applmgr/common/java/appsborg.zip:/u02/app/applmgr/common/java/apps.zip:/u02/app/applmgr/product/8.0.6_115102/forms60/java:/u02/app/applmgr/common/java"
export AF_CLASSPATH

show be:

Example of AF_CLASSPATH setting:
/local/java/jdk1.3.1/lib/dt.jar:/local/java/jdk1.3.1/lib/tools.jar:/slot05/appmgr/atgwfqacomn/java/appsborg2.zip:/slot05/appmgr/atgwfqaora/8.0.6/forms60/java:/slot05/appmgr/atgwfqacomn/java


dbtier.applmgr->grep classpath $APPL_TOP/admin/BHUP_dbtier.xml
                        <jserv_classpath_begin oa_var="s_jserv_classpath_begin"># wrapper.classpath =</jserv_classpath_begin>
                        <jserv_classpath_end oa_var="s_jserv_classpath_end"># wrapper.classpath =</jserv_classpath_end>
                        <jserv_zone_classpath_begin oa_var="s_jserv_zone_classpath_begin"> </jserv_zone_classpath_begin>
                        <jserv_zone_classpath_end oa_var="s_jserv_zone_classpath_end"> </jserv_zone_classpath_end>
                        <CLASSPATH oa_var="s_adovar_classpath" osd="unix">/u02/app/applmgr/common/util/jre/1.1.8/lib/rt.jar:/u02/app/applmgr/common/util/jre/1.1.8/lib/i18n.jar:/u02/app/applmgr/common/util/jre/1.1.8/lib/tools.jar:/u02/app/applmgr/common/java/appsborg.zip:/u02/app/applmgr/common/java/apps.zip:/u02/app/applmgr/product/8.0.6_115102/forms60/java:/u02/app/applmgr/common/java</CLASSPATH>
                        <AF_CLASSPATH oa_var="s_adovar_afclasspath" osd="unix">/u02/app/applmgr/common/util/jre/1.1.8/lib/rt.jar:/u02/app/applmgr/common/util/jre/1.1.8/lib/i18n.jar:/u02/app/applmgr/common/java/appsborg.zip:/u02/app/applmgr/common/java/apps.zip:/u02/app/applmgr/product/8.0.6_115102/forms60/java:/u02/app/applmgr/common/java</AF_CLASSPATH>
                        <enabler_classpath oa_var="s_jto_enabler_classpath"> </enabler_classpath>
                        <jto_classpath oa_var="s_jto_classpath" osd="unix">.:/u02/app/applmgr/common/java/jdbc111.zip:/u02/app/applmgr/common/java/xmlparserv2.zip:/u02/app/applmgr/common/java:/u02/app/applmgr/common/java/apps.zip:/u02/app/applmgr/common/util/jre/1.1.8/classes:/u02/app/applmgr/common/util/jre/1.1.8/lib:/u02/app/applmgr/common/util/jre/1.1.8/lib/classes.zip:/u02/app/applmgr/common/util/jre/1.1.8/lib/classes.jar:/u02/app/applmgr/common/util/jre/1.1.8/lib/rt.jar:/u02/app/applmgr/common/util/jre/1.1.8/lib/i18n.jar:/u02/app/applmgr/common/java/3rdparty/RFJavaInt.zip:</jto_classpath>
                        <start_cmd oa_var="s_jtffstart">/u02/app/applmgr/common/util/jre/1.1.8/bin/jre -mx128m -classpath .:/u02/app/applmgr/common/java/jdbc111.zip:/u02/app/applmgr/common/java/xmlparserv2.zip:/u02/app/applmgr/common/java:/u02/app/applmgr/common/java/apps.zip:/u02/app/applmgr/common/util/jre/1.1.8/classes:/u02/app/applmgr/common/util/jre/1.1.8/lib:/u02/app/applmgr/common/util/jre/1.1.8/lib/classes.zip:/u02/app/applmgr/common/util/jre/1.1.8/lib/classes.jar:/u02/app/applmgr/common/util/jre/1.1.8/lib/rt.jar:/u02/app/applmgr/common/util/jre/1.1.8/lib/i18n.jar:/u02/app/applmgr/common/java/3rdparty/RFJavaInt.zip: -Dengine.LogPath=/u02/app/applmgr/common/admin/log/BHUP_dbtier -Dengine.TempDir=/u02/app/applmgr/common_cm/temp -Dengine.CommandPort=9300 -Dengine.AOLJ.config=/u02/app/applmgr/11.5/fnd/11.5.0/secure/dbtier_xupg.dbc -Dengine.ServerID=5000 -Ddebug=full -Dengine.LogLevel=9 -Dlog.ShowWarnings=false -Dengine.FaxEnabler=oracle.apps.jtf.fm.engine.rightfax.RfFaxEnablerImpl -Dengine.PrintEnabler=oracle.apps.jtf.fm.engine.rightfax.RfPrintEnablerImpl -Dfax.TempDir=/u02/app/applmgr/common/admin/log/BHUP_dbtier -Dprint.TempDir=/u02/app/applmgr/common/admin/log/BHUP_dbtier oracle.apps.jtf.fm.FulfillmentServer &gt;&gt; /u02/app/applmgr/common/admin/log/BHUP_dbtier/jtffmctl.txt</start_cmd>

things that need to be changed:



SOLUTION
----------

##
## FIX AF_CLASSPATH
##

## EXISTING SETTING [WRONG] ##
dbtier.applmgr->grep s_adovar_afclasspath $APPL_TOP/admin/BHUP_dbtier.xml
                        <AF_CLASSPATH oa_var="s_adovar_afclasspath" osd="unix">/u02/app/applmgr/common/util/jre/1.1.8/lib/rt.jar:/u02/app/applmgr/common/util/jre/1.1.8/lib/i18n.jar:/u02/app/applmgr/common/java/appsborg.zip:/u02/app/applmgr/common/java/apps.zip:/u02/app/applmgr/product/8.0.6_115102/forms60/java:/u02/app/applmgr/common/java</AF_CLASSPATH>

## SHOULD BE ##
Example of AF_CLASSPATH setting:
/local/java/jdk1.3.1/lib/dt.jar:
/local/java/jdk1.3.1/lib/tools.jar:
/slot05/appmgr/atgwfqacomn/java/appsborg2.zip:
/slot05/appmgr/atgwfqaora/8.0.6/forms60/java:
/slot05/appmgr/atgwfqacomn/java

## OUR MAPPING BE ##
/usr/j2se/lib/dt.jar:
/usr/j2se/lib/tools.jar:
/u02/app/applmgr/common/java/appsborg2.zip:
/u02/app/applmgr/product/8.0.6_115102/forms60/java:
/u02/app/applmgr/common/java

## OUR MAPPING MT ##
/usr/j2se/lib/dt.jar:
/usr/j2se/lib/tools.jar:
/u01/app/applmgr/common/java/appsborg2.zip:
/u01/app/applmgr/product/8.0.6_115102/forms60/java:
/u01/app/applmgr/common/java


## FIXED SETTING ##
dbtier.applmgr->grep s_adovar_afclasspath $APPL_TOP/admin/BHUP_dbtier.xml
                        <AF_CLASSPATH oa_var="s_adovar_afclasspath" osd="unix">/usr/j2se/lib/dt.jar:/usr/j2se/lib/tools.jar:/u02/app/applmgr/common/java/appsborg2.zip:/u02/app/applmgr/product/8.0.6_115102/forms60/java:/u02/app/applmgr/common/java</AF_CLASSPATH>

midtier.applmgr->grep s_adovar_afclasspath $APPL_TOP/admin/BHUP_midtier.xml
         <AF_CLASSPATH oa_var="s_adovar_afclasspath" osd="unix">/usr/j2se/lib/dt.jar:/usr/j2se/lib/tools.jar:/u01/app/applmgr/common/java/appsborg2.zip:/u01/app/applmgr/product/8.0.6_115102/forms60/java:/u01/app/applmgr/common/java</AF_CLASSPATH>


##
## FIX java exe definition
##

## EXISTING SETTING [WRONG] ##
dbtier.applmgr->grep -i AF_JRE_TOP $APPL_TOP/admin/BHUP_dbtier.xml
                        <AF_JRE_TOP oa_var="s_afjretop">/u02/app/applmgr/common/util/jre/1.1.8</AF_JRE_TOP>

dbtier.applmgr->grep -i AFJVAPRG $APPL_TOP/admin/BHUP_dbtier.xml
                        <AFJVAPRG oa_var="s_afjvaprg" osd="UNIX">/u02/app/applmgr/common/util/jre/1.1.8/bin/jre</AFJVAPRG>


## SHOULD BE ##

AF_JRE_TOP=/usr/j2se
export AF_JRE_TOP

AFJVAPRG=/usr/j2se/bin/java
export AFJVAPRG

## FIXED SETTING ##
dbtier.applmgr->grep -i AF_JRE_TOP $APPL_TOP/admin/BHUP_dbtier.xml
                        <AF_JRE_TOP oa_var="s_afjretop">/usr/j2se</AF_JRE_TOP>

dbtier.applmgr->grep -i AFJVAPRG $APPL_TOP/admin/BHUP_dbtier.xml
                        <AFJVAPRG oa_var="s_afjvaprg" osd="UNIX">/usr/j2se/bin/java</AFJVAPRG>

midtier.applmgr->grep -i AF_JRE_TOP $APPL_TOP/admin/BHUP_midtier.xml
         <AF_JRE_TOP oa_var="s_afjretop">/usr/j2se</AF_JRE_TOP>

midtier.applmgr->grep -i AFJVAPRG $APPL_TOP/admin/BHUP_midtier.xml
         <AFJVAPRG oa_var="s_afjvaprg" osd="UNIX">/usr/j2se/bin/java</AFJVAPRG>


##
## Re-run AutoConfig
##

## BE tier
$AD_TOP/bin/adconfig.sh contextfile=$APPL_TOP/admin/BHUP_dbtier.xml appspass=pass


## MT tier
$AD_TOP/bin/adconfig.sh contextfile=$APPL_TOP/admin/BHUP_midtier.xml appspass=pass



## MT tier
##
## comment out the following lines from jserv.properties and jserv.conf:
## refer to SR:780 11.5.10.2 AppsLocalLogin.jsp Internal Server Error
##

vi /u01/app/applmgr/product/iAS_115102/Apache/Jserv/etc/jserv.properties
#zones=mobile
#mobile.properties=/u01/app/applmgr/product/iAS_115102/Apache/Jserv/etc/mobile.properties

vi /u01/app/applmgr/product/iAS_115102/Apache/Jserv/etc/jserv.conf
#ApJServGroupMount /mobile       balance://OACoreGroup/mobile



##
## Shutdown Services
##

## BE tier
/u02/app/applmgr/common/admin/scripts/BHUP_dbtier/adstpall.sh apps/pass

## MT tier
/u01/app/applmgr/common/admin/scripts/BHUP_midtier/adstpall.sh apps/pass



## 
## Start Services
##

## BE tier
exit
su - applmgr
/u02/app/applmgr/common/admin/scripts/BHUP_dbtier/adstrtal.sh apps/pass


## MT tier
exit
su - applmgr
/u01/app/applmgr/common/admin/scripts/BHUP_midtier/adstrtal.sh apps/pass



##
## TEST call to external SMTP server
##
$AFJVAPRG -classpath $AF_CLASSPATH -Dprotocol=smtp -Dserver=mailhub.company.com \
-Dport=25 -Daccount=oracle.dba@company.com -Dconnect_timeout=120 \
oracle.apps.fnd.wf.mailer.Mailer

dbtier.applmgr->$AFJVAPRG -classpath $AF_CLASSPATH -Dprotocol=smtp -Dserver=mailhub.company.com \
-Dport=25 -Daccount=oracle.dba@company.com -Dconnect_timeout=120 \
oracle.apps.fnd.wf.mailer.Mailer
> -Dport=25 -Daccount=oracle.dba@company.com -Dconnect_timeout=120 \
> oracle.apps.fnd.wf.mailer.Mailer
Server mailhub.company.com at port 25 is reachable
Successfully connected to the SMTP account



REFERENCE:
   Note:242941.1 How To Troubleshoot Java-based Workflow Notification Mailer In 11.5.9 and OWF.G
   Note:278127.1 Workflow Notification Will Not Start After Cloning
   Note:278163.1 Workflow Notification Mailer Will Not Start
9205
2008-JUN-05 03:36:53
User
 
 
Registered On: Jun 2008
Total Posts: 1
i had the same error for Wokflow Mailer , after i created a new environment 
from production environment:

LOG_ID_UNKNOWN : oracle.apps.fnd.cp.gsc.Logger.Logger(String, int) : Logging to 
System.out until necessary parameters are retrieved for Logger to be properly 
started.
LOG_ID_UNKNOWN : oracle.apps.fnd.cp.gsm.GSMSvcComponentContainer.initializeStateMachine() 
: BEGIN
LOG_ID_UNKNOWN : oracle.apps.fnd.cp.gsc.SvcComponentContainer.getNewWorkflowContext() 
: BEGIN
LOG_ID_UNKNOWN : oracle.apps.fnd.cp.gsc.SvcComponentContainer.getNewWorkflowContext() 
: BEGIN
Could not start Service Component Container because an unexpected 
RuntimeException or other Throwable occurred -> java.lang.NoClassDefFoundError: 
oracle/apps/fnd/profiles/Profiles
java.lang.NoClassDefFoundError: oracle/apps/fnd/profiles/Profiles
    at oracle.apps.fnd.profiles.ExtendedProfileStore.clear(Compiled Code)
    at oracle.apps.fnd.security.SessionManager.setUser(Compiled Code)
    at oracle.apps.fnd.security.SessionManager.setUser(Compiled Code)
    at oracle.apps.fnd.wf.apps.ContextFactory.makeContext(Compiled Code)
    at oracle.apps.fnd.wf.common.WorkflowContext.<init>(Compiled Code)
    at oracle.apps.fnd.cp.gsc.SvcComponentContainer.getNewWorkflowContext(Compiled 
Code)
    at oracle.apps.fnd.cp.gsc.SvcComponentContainer.start(Compiled Code)
    at oracle.apps.fnd.cp.gsm.GSMSvcComponentContainer.main(Compiled Code)

The solution for my case was::

I reconfigured the entries from adovars.env file with the 
correct info for the following:

AF_JRE_TOP="/apptest3/oracle/nicora/iAS/Apache/j2sdk1_3_1_06"
export AF_JRE_TOP

AFJVAPRG=/apptest3/oracle/nicora/iAS/Apache/j2sdk1_3_1_06/bin/java
export AFJVAPRG

AF_CLASSPATH="$AF_JRE_TOP/jre/lib/rt.jar:$AF_JRE_TOP/jre/lib/i18n.jar:$AF_JRE_TOP/lib/dt.jar:$AF_JRE_TOP/lib/tools.jar:$JAVA_TOP/appsborg2.zip:$ORACLE_HOME/forms60/java:$JAVA_TOP"
export AF_CLASSPATH

After that i scheduled Workflow Control Queue Cleanup program , run 
cmcclean.sql and restart the concurrent and 
now everything works nice.

cmclean.sql -- see below. Also you can take it from metalink.

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   $Id: cmclean.sql,v 1.4 2001/04/07 15:55:07 pferguso Exp $
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 -----------------------------------------------------