Ora-31001 Using Dbms_network_acl_admin.Create_acl (Doc ID 838908.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 11.1.0.6 and later
Information in this document applies to any platform.
Checked for relevance on 19-Feb-2015


Symptoms


We get error:

ORA-31001: Invalid resource handle or path name "/sys/acls/localhost.xml"

while trying to create an ACL

 

connect / AS sysdba

set echo on
set termout on
set feed on

show user

DECLARE
SERVLET_NAME VARCHAR2(32) := 'orawsv';
BEGIN
DBMS_XDB.deleteServletMapping(SERVLET_NAME);
DBMS_XDB.deleteServlet(SERVLET_NAME);
DBMS_XDB.addServlet(NAME => SERVLET_NAME,
LANGUAGE => 'C',
DISPNAME => 'Oracle Query Web Service',
DESCRIPT => 'Servlet for issuing queries as a Web Service',
SCHEMA => 'XDB');
DBMS_XDB.addServletSecRole(SERVNAME => SERVLET_NAME,
ROLENAME => 'XDB_WEBSERVICES',
ROLELINK => 'XDB_WEBSERVICES');
DBMS_XDB.addServletMapping(PATTERN => '/orawsv/*',
NAME => SERVLET_NAME);
END;
/

begin
DBMS_NETWORK_ACL_ADMIN.DROP_ACL('localhost.xml');
dbms_network_acl_admin.create_acl(
acl => 'localhost.xml'
,description => 'ACL for 127.0.0.1'
,principal => 'myname'
,is_grant => true
,privilege => 'connect');
dbms_network_acl_admin.assign_acl('localhost.xml', '127.0.0.1');
end;
/

Got following errors:
ERROR at line 1:
ORA-31001: Invalid resource handle or path name "/sys/acls/localhost.xml"
ORA-06512: at "XDB.DBMS_XDB", line 331
ORA-06512: at "SYS.DBMS_NETWORK_ACL_ADMIN", line 392
ORA-06512: at line 2

 

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms