Help authorizing JCHEM user

User 8ef5099b33

29-07-2009 19:57:34

Hi,


I need a little help properly configuring our jchem cartridge.


I log into the database with SqlPlus.


I issue the following command to grant permissions to JCHEM:



SQL> call dbms_java.grant_permission( 'JCHEM', 'SYS:java.net.SocketPermission', 'jchemserver.xxx.corp','resolve');


Call completed.


However, if I try to check on the jchem cartride. I get the following error:


SQL> SELECT jchem_core_pkg.getenvironment() FROM dual;


SELECT jchem_core_pkg.getenvironment() FROM dual


       *


ERROR at line 1:


ORA-29532: Java call terminated by uncaught Java exception:


java.lang.Exception: Problem connecting to JChemServer:


rmi://jchemerver.xxx.corp:1099: the Permission (java.net.SocketPermission


jchemserver.xxx.corp resolve) has not been granted to JCHEM. The PL/SQL to


grant this is dbms_java.grant_permission( 'JCHEM',


'SYS:java.net.SocketPermission', 'jchemserver.xxx.corp', 'resolve' )


ORA-06512: at "JCHEM.JCHEM_CORE_PKG", line 29


ORA-06512: at "JCHEM.JCHEM_CORE_PKG", line 80


 


What additional steps do I need to do?


Could someone please help with this little issue?


 


Cheers,


Guy




 

ChemAxon aa7c50abf8

30-07-2009 13:09:07

Hi Guy,


The likely candidate to cause this problem is that you are trying to execute the jchem_core_pkg.getenvironment function in the same database session as before. When granting privileges to users, you often have to start a new database session to exercise the newly obtained privilege. The grant will often not affect existing database sessions.


This probably isn't related to the problem, but I mention it anyway:


In addition to the 'resolve' privilege, you will also need to grant 'connect' privilege. You can grant both in one statement by using a comma-separated list:


call dbms_java.grant_permission( 'JCHEM', 'SYS:java.net.SocketPermission', 'jchemserver.xxx.corp','resolve,connect');


Cheers,


Peter