I have a recent 11g installation with a developer that is getting a access denied message when using a package but is able to run the same code manually in sqlplus and it works.

eg. I have granted access to connect and resolve to the user BLAH.

from sqlplus, BLAH can do

select trim(substr(utl_inaddr.get_host_name,1,30)) from dual;
and get the hostname successfully, but this same line in a pkb fails when called like so

exec func_name.something()
BEGIN func_name.something(); END;

ERROR at line 1:
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.UTL_INADDR", line 4
ORA-06512: at "SYS.UTL_INADDR", line 35
ORA-06512: at line 1
ORA-06512: at "BLAH.FUNC_NAME", line 83
ORA-06512: at line 1
but if you were to do this same bit of code in sqlplus as follows:

set serveroutput on
  mhost varchar(30);
select trim(substr(utl_inaddr.get_host_name,1,30))  into mhost
   from dual;
it works.

I do not understand this at all. This is the same user account that owns the pkb and is running it in sqlplus. The user has been granted the connect and resolve priv through being granted a role that has this permission.

Can anyone help me out here?