1 Reply Latest reply: Jul 21, 2012 5:04 PM by rp0428 RSS

    Class not found in Java Stored procedure

    950905

      I have loaded java classes in oracle. But When I am calling a function which is AS LANGAUGE JAVA. Its returing me exception ORA-29540: class InventoryAdjustmentDEOType does not exist--29540.

      My Java class owner is SYS but I am calling it from another Login. Is it cause for issue.?

      Please ignore any mistake as I am new to JavaStoredProcedures.

        • 1. Re: Class not found in Java Stored procedure
          rp0428
          Welcome to the forum!
          >
          My Java class owner is SYS but I am calling it from another Login. Is it cause for issue.?
          >
          First you should not be creating objects as SYS. Although it is legal it is not at all recommended.

          Your Java 'class' owner is SYS? Or the stored procedure owner is SYS? Which is it?

          To call stored procedures using a different schema you have to grant EXECUTE permission on the stored procedure to the other user.

          So if SYS owns the procedure MY_PROC and you want to allow user SCOTT to execute it grant SCOTT the EXECUTE privilege.
          GRANT EXECUTE ON MY_PROC TO SCOTT;
          I am new to JavaStoredProcedures
          >
          Then may I suggest you start reviewing the Java Developer's Guide
          http://docs.oracle.com/cd/B28359_01/java.111/b31225/chfive.htm

          Chapter 5 covers 'Developing Java Stored Procedures' and the 'Security' section provides the answer to your question
          >
          In Oracle Database, all classes are loaded into a secure database and, therefore, are untrusted. A user requires the appropriate permissions to access classes and operating system resources. Likewise, all stored procedures are secured against other users. You can grant the EXECUTE database privilege to users who need to access the stored procedures.