This discussion is archived
4 Replies Latest reply: May 2, 2013 10:31 PM by Kiran RSS

Enabling Network Services not working PLEASE HELP

988139 Newbie
Currently Being Moderated
Hello,

I created a virtual machine with the Oracle_Developer_Day.ova file downloaded from oracle page in order to test the application express tool.

I´m trying to ad a webservice reference but getting the error:

ORA-29273: HTTP request failed ORA-06512: at "SYS.UTL_HTTP", line 1130 ORA-24247: network access denied by access control list (ACL)

I researched and find out that oracle 11g does not have network services enabled so you have to enable them with the following script:

DECLARE
ACL_PATH VARCHAR2(4000);
ACL_ID RAW(16);
BEGIN
-- Look for the ACL currently assigned to '*' and give APEX_030200
-- the "connect" privilege if APEX_030200 does not have the privilege yet.
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
-- Before checking the privilege, ensure that the ACL is valid
-- (for example, does not contain stale references to dropped users).
-- If it does, the following exception will be raised:
--
-- ORA-44416: Invalid ACL: Unresolved principal 'ADMIN'
-- ORA-06512: at "XDB.DBMS_XDBZ", line ...
--
SELECT SYS_OP_R2O(extractValue(P.RES, '/Resource/XMLRef')) INTO ACL_ID
FROM XDB.XDB$ACL A, PATH_VIEW P
WHERE extractValue(P.RES, '/Resource/XMLRef') = REF(A) AND
EQUALS_PATH(P.RES, ACL_PATH) = 1;

DBMS_XDBZ.ValidateACL(ACL_ID);
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'HR',
'connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
'HR', TRUE, 'connect');
END IF;

EXCEPTION
-- When no ACL has been assigned to '*'.
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
'ACL that lets power users to connect to everywhere',
'HR', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/
COMMIT;

***Note: I have a workspace called HR and a user called HR.

I run the script and everything works fine but when I try to add the webservice reference I get the same error.

I don´t know what to do and my time to fixing this problem is ending so please if someone can help me I would really appreciate it.

THanks in advance
  • 1. Re: Enabling Network Services not working PLEASE HELP
    Marc Sewtz Pro
    Currently Being Moderated
    Hi,

    Have you checked which version of APEX you're running in your VM? The script below would work for APEX_030200, but if you have a current VM, it's probably APEX_040100 or APEX_040200. Just connect to your database, and check what APEX schema is installed, then update your script accordingly and run again.

    Regards,
    Marc
  • 2. Re: Enabling Network Services not working PLEASE HELP
    988139 Newbie
    Currently Being Moderated
    Thanks, yes it was that.

    Took me a while hehe

    Thanks for your help.
  • 3. Re: Enabling Network Services not working PLEASE HELP
    luisrivera Newbie
    Currently Being Moderated
    Could you post your full script please, I'm in the same situation.

    Tnks
  • 4. Re: Enabling Network Services not working PLEASE HELP
    Kiran Expert
    Currently Being Moderated
    Hi Luis,

    You will find the script for the relevant releases in the respective installation guides of their releases.

    Here is the script for Oracle APEX 4.1 and its sub-version releases:
    DECLARE
      ACL_PATH  VARCHAR2(4000);
    BEGIN
      -- Look for the ACL currently assigned to '*' and give APEX_040100
      -- the "connect" privilege if APEX_040100 does not have the privilege yet.
     
      SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
       WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
     
      IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040100',
         'connect') IS NULL THEN
          DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
         'APEX_040100', TRUE, 'connect');
      END IF;
     
    EXCEPTION
      -- When no ACL has been assigned to '*'.
      WHEN NO_DATA_FOUND THEN
      DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
        'ACL that lets power users to connect to everywhere',
        'APEX_040100', TRUE, 'connect');
      DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
    END;
    /
    COMMIT;
    Refer : http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21673/otn_install.htm#BEHGBHDF

    Here is the script for Oracle APEX 4.2 and its sub-version releases:
    DECLARE
      ACL_PATH  VARCHAR2(4000);
    BEGIN
      -- Look for the ACL currently assigned to '*' and give APEX_040200
      -- the "connect" privilege if APEX_040200 does not have the privilege yet.
     
      SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
       WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
     
      IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200',
         'connect') IS NULL THEN
          DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
         'APEX_040200', TRUE, 'connect');
      END IF;
     
    EXCEPTION
      -- When no ACL has been assigned to '*'.
      WHEN NO_DATA_FOUND THEN
      DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
        'ACL that lets power users to connect to everywhere',
        'APEX_040200', TRUE, 'connect');
      DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
    END;
    /
    COMMIT;
    Refer: http://docs.oracle.com/cd/E37097_01/doc/install.42/e35123/otn_install.htm#BEHGBHDF

    Hope it Helps!
    Regards,
    Kiran

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points