1 Reply Latest reply: Jun 25, 2009 2:36 PM by mjungerm RSS

    Oracle Java proc ORA-04045: errors during recompilation/revalidation


      I have Oracle Java stored proc called MERGE_ENTITY_AND_EVENT invoked by a trigger. It was working fine for a couple of weeks. Today it throws this generic exception. I'm not sure what changed.

      Caused by: java.sql.SQLSyntaxErrorException: ORA-04045: errors during recompilation/revalidation of TLMDEV./3ba8073b_Log4JLogger
      ORA-06512: at "MERGE_ENTITY_AND_EVENT", line 1
      ORA-06512: at "QUOTE_TRIGGER", line 49

      1. What is the root cause of this exception ?
      2. Whats the solution ?

      If you dont know 1 or 2, how would you go about debugging this problem ?

      Thanks in advance.
        • 1. Re: Oracle Java proc ORA-04045: errors during recompilation/revalidation
          The most likely cause is that something has caused the class TLMDEV./3ba8073b_Log4JLogger to become invalid and implicit invalidation does not succeed in making it valid. In general a class must be valid in order to be run and an attempt to run an invalid class (such as because your trigger calls it) will cause an attempt to validate it and if that attempt fails an ORA-04045 can be the result. Validation of a class amounts to iterating over the set of names referenced by the class and looking for a valid class by that name, perhaps recursively attempting to validate if an invalid class by that name is found. So validation of a class may amount to an attempt to validate several classes at once. If any of them fail to be validatable, which occurs if there is no class for a given referenced name then most if not all of the classes in the set being validated and certainly the top level one will fail to validate. So if things are working correctly, the ultimate reason for the ORA-04045 will prove to be that some name referenced by TLMDEV./3ba8073b_Log4JLogger or recursived by something it references will be a name for which there is no class in the database (or more precisely in the search path used which is typically the current schema followed by PUBLIC, but could be different if some of the classes involved have had explicit resolver specifications given for them). The thing to do to try to start determining what class is missing is to do the query

          select owner||'.'||name||' : '||text from all_errors where type like 'JAVA%';

          The first thing to look at are lines for TLMDEV./3ba8073b_Log4JLogger. These will probably show text which contains either ORA-29534 identifying a referenced class that exists but could not be recursively valid, or ORA-29521 identifying names for which there is no class. The latter are the ultimately interesting ones since the former will end up being recursively caused by them. So look at the ORA-29521s and then try to determine either why the class is missing and how to restore it or which it is now referenced when it wasn't before (which would happen if some class was changed to reference it or something that references it, recursively).