When attempting to approve Purchase Orders via Email an error occurs during the activity 'Notify
Approver Subprocess/Approve PO Notification'. It shows the following Errored Activities:
ERROR
Activity: Approve PO Notification
Result: #MAIL
Error Name: WF_ERROR
Error message: [WF_ERROR] ERROR_MESSAGE=3835: Error '-20002 - ORA-20002: 2018: Unable to generate the notification XML. Caused by: 2020:Error when getting notification content. Caused by:
ORA-04068: existing state of has been invalidated
ORA-04061: existing state of package body "APPS.PO_WF_PO_NOTIFICATION" has been invalidated
ORA-04065: not executed, altered or dropped package body "APPS.PO_WF_PO_NOTIFICATION"
ORA-06508: PL/SQL: could not find program unit being called
wf_notification.GetAttrDoc2(1209521, PO_LINES_DETAILS, text/html)
Wf_Notification.GetAttrDoc(' encountered during execution of Generate function 'WF_XML.Generate'
for event 'oracle.apps.wf.notification.send'.
ERROR_STACK= WF_MAIL.GetLOBMessage3(1209521, WFMAIL, 2020: Error when getting notification content. Caused by: ORA-04061: existing state of has been invalidated
ORA-04061: existing state of package body "APPS.PO_WF_PO_NOTIFICATION" has been invalidated
ORA-04065: not executed, altered or dropped package body "APPS.PO_WF_PO_NOTIFICATION"
ORA-06508: PL/SQL: could not find program unit being called
wf_notification.GetAttrDoc2(1209521, PO_LINES_DETAILS, text/html)
Wf_Notification.GetAttrDoc(1209521, PO_LINES_DETAILS, text/html)
Wf_Notification.GetText(1209521, text/html)
Wf_Notification.GetBody(1209521, text/html)
WF_NOTIFICATION.GetFullBody(nid => 1209521, disptype => text/html)
WF_MAIL.GetLOBMessage3(nid => 1209521, r_ntf_pref => MAILHTML), Step -> Getting text/html
body)
WF_XML.GenerateDoc(oracle.apps.wf.notification.send, 1209521)
WF_XML.Generate(oracle.apps.wf.notification.send, 1209521)
WF_XML.Generate(oracle.apps.wf.notification.send, 1209521)
Wf_Event.setMessage(oracle.apps.wf.notification.send, 1209521, WF_XML.Generate)
Wf_Event.dispatch_internal()
Cause
When a package is compiled, all copies in the shared pool are flagged as invalid. The error ORA-04061 in the error stack is caused because the notification mailer is reading an old version of the package stored in memory.
Solution
Follow these steps to resolve the issue:
1. Shutdown the Notification Mailer and Workflow Deferred Notification Agent Listener
2. Recompile the APPS schema through ADADMIN
3. Start the Notification Mailer and agent listener and re-test