ORA-22285 Error while trying to register an xsd schema on oracle database Here is the code for user "system"

create or replace directory xml_mape as 'D:\app\Gusts\xml_mape';
GRANT READ,WRITE ON DIRECTORY xml_mape to lietotajs;


Im trying to access the xsd file "dok1_shema.xsd"on the directory "xml_mape"
And here is the code for user "lietotajs"

begin
  DBMS_XMLSCHEMA.REGISTERSCHEMA(
    SCHEMAURL =&gt; 'http://localhost:8080/public/dok1_shema.xsd',
    SCHEMADOC =&gt; bfilename ('xml_mape', 'dok1_shema.xsd'),
    LOCAL     =&gt; TRUE,
   GENTYPES  =&gt; FALSE,
   GENTABLES =&gt; TRUE,
   OPTIONS   =&gt; DBMS_XMLSCHEMA.REGISTER_BINARYXML);

  end;


I get the following error:

Error starting at line : 1 in command -
begin
  DBMS_XMLSCHEMA.REGISTERSCHEMA(
    SCHEMAURL =&gt; 'http://localhost:8080/public/dok1_shema.xsd',
    SCHEMADOC =&gt; bfilename ('xml_mape', 'dok1_shema.xsd'),
    LOCAL     =&gt; TRUE,
   GENTYPES  =&gt; FALSE,
   GENTABLES =&gt; TRUE,
   OPTIONS   =&gt; DBMS_XMLSCHEMA.REGISTER_BINARYXML);

  end;
Error report -
ORA-22285: non-existent directory or file for FILEOPEN operation
ORA-06512: at "SYS.DBMS_LOB", line 744
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 131
ORA-06512: at line 2
22285. 00000 -  "non-existent directory or file for %s operation"
*Cause:    Attempted to access a directory that does not exist, or attempted
           to access a file in a directory that does not exist.
*Action:   Ensure that a system object corresponding to the specified
           directory exists in the database dictionary, or
           make sure the name is correct.


Nothing i try to change seems to have any impact.
Unless specified otherwise, directory objects names are stored as uppercase strings, and you need to reference them like that in such cases:

SQL&gt; !ls -l /home/oracle/hello.txt
-rw-r--r--. 1 oracle oinstall 6 Jan  9 14:05 /home/oracle/hello.txt

SQL&gt; create or replace directory hello as '/home/oracle';

Directory created.

declare
  v_file bfile;
  ret integer;
begin
  v_file := bfilename('hello', 'hello.txt');
  ret := dbms_lob.fileexists(v_file);
end;
  8  /
declare
*
ERROR at line 1:
ORA-22285: non-existent directory or file for FILEEXISTS operation
ORA-06512: at "SYS.DBMS_LOB", line 803
ORA-06512: at line 6


declare
  v_file bfile;
  ret integer;
begin
  v_file := bfilename('HELLO', 'hello.txt');
  ret := dbms_lob.fileexists(v_file);
end;
  8  /

PL/SQL procedure successfully completed.

SQL&gt;