ORA-31145 – “Duplicate listener, %s, found in resource configuration”
Today I had an error on my test environment which surprised me…initially…
While I was testing a JSON_TABLE on a JSON document which I put in the XDB Repository environment via FTP, it signaled this ORA-31145 error.
$> oerr ORA 31145
31145, 00000, "Duplicate listener, %s, found in resource configuration"
// *Cause: Duplicate listener source was found in resource configuration.
// *Action: Remove duplicates and resubmit statement.
//
Apparently it looks like I somehow created two XDB Event listeners associated, via a resource configuration file, on the same XDB repository resource (=file/folder). In this case on my JSON file “content.json” in folder /public/json, I was experimenting with.
The statement I attempted to execute:
select xdburitype('/public/json/content.json').getclob()
as content
from dual;
For fun I wanted to, based on the mentioned post, debug/log all events going on in the XDB Repository via using package HANDLE_XDB_EVENTS.
I created a XDB resource via:
--
-- Map all things in the repository via "DBMS_RESCONFIG.addRepositoryResConfig"
--
-- This needs the event handler PL/SQL package to be accessable for all database users
--
GRANT EXECUTE on XDBA.HANDLE_XDB_EVENTS to PUBLIC;
--
-- Create new resource to log rendering of all xdb repository actions
--
DECLARE
b BOOLEAN := FALSE;
BEGIN
b := DBMS_XDB.createResource(
'/xdb/res/RenderAll.xml',
'XDB Event Logging - Render AllXDBAHANDLE_XDB_EVENTS
PL/SQL/xdb/res/UploadHandling.xml');
END;
/
--
commit;
--
-- Add the resource to XDB repository listener events
--
BEGIN
DBMS_RESCONFIG.addRepositoryResConfig('/xdb/res/RenderAll.xml', NULL);
END;
/
--
commit;
--
This now got me in problems due to that I had forgotten that I also had the same package linked to /public via a different resource file and all under / via the DBMS_RESCONFIG.addRepositoryResConfig method.
This is shown via, eg., the following statements
--
SELECT xmlserialize(CONTENT dbms_resconfig.getRepositoryResConfig(0)
as CLOB indent size=1) as xmlcontent
FROM dual;
--
XDB Event Logging - Render AllXDBAHANDLE_XDB_EVENTS
PL/SQL/xdb/res/UploadHandling.xml
--
SELECT xmlserialize(CONTENT dbms_resconfig.getlisteners('/public/json/content.json')
as CLOB indent size=1) as xmlcontent
FROM dual;
--
XDB Event Logging - Render AllXDBAHANDLE_XDB_EVENTS
PL/SQLCategory applicationXDBAHANDLE_XDB_EVENTS
PL/SQL
--
SELECT column_value as "Local XDB Resource File"
FROM TABLE(dbms_resconfig.getresconfigpaths('/public/json/content.json'));
--
Local XDB Resource File
---------------------------
/xdb/res/UploadHandling.xml
--
As you can notice…there is a double entry that triggers my XDB_EVENT based package “HANDLE_XDB_EVENTS” via /xdb/res/UploadHandling.xml.
I solved the issue for now (I don’t want yet my default logging experiments to disappear) via
--
execute dbms_resconfig.deleteresconfig('/public/json/content.json', 0);
commit;
--
SELECT column_value as "Local XDB Resource File"
FROM TABLE(dbms_resconfig.getresconfigpaths('/public/json/content.json'));
--
no rows selected.
--
If I now make another attempt via my initial statement, I get the JSON output…
Bad Behavior has blocked 345 access attempts in the last 7 days.
This site uses cookies to ensure that it provides you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OKRead more