My Oracle Support Banner

APEX_MAIL / HTMLDB_MAIL Failing Unexpectedly (Doc ID 434137.1)

Last updated on SEPTEMBER 30, 2019

Applies to:

Oracle Application Express (APEX) - Version 2.0 and later
Information in this document applies to any platform.

Symptoms

APEX_MAIL (or HTMLDB_MAIL) is not working correctly when called from a DBMS_SCHEDULER job which calls the send email procedure. The error that is seen in SQLPLUS is:


This procedure must be invoked from within an application session.



This error is being caused by the WWV_FLOW_API.SET_SECURITY_GROUP_ID request executed just prior to the APEX_MAIL email request.

 

 

Running the query following query in SQLPLUS returns the following:

select wwv_flow_api.get_security_group_id from dual;

GET_SECURITY_GROUP_ID
0



This procedure used to return a Workspace ID, but is now failing. The purpose of WWV_FLOW_API.SET_SECURITY_GROUP_ID is to set the package variable that contains the workspace ID of a workspace to which the schema is assigned. After this package variable is set, the security check in the mail package is satisfied that an authorized caller invoked it. Since WWV_FLOW_API.SET_SECURITY_GROUP_ID is no longer returning a valid workspace ID, the APEX_MAIL package is failing.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.