What to do with those invalid JAVA CLASS object type objects in SYS prior to the upgrade the oracle db from 10g to 11g? I am ready to upgrade the oracle 10g prod db to 11g, but we have 130 invalid objects in SYS (all are belong to JAVA CLASS object_type). And from the best practice of oracle upgrade from 10g to 11g, it said should not have any invalid objects in sys or system schema. But I already ran the utlrp.sql to recompile all invalid objects script multiple times, those invalid JAVA CLASS object_type objects are persistent in SYS user. And I tried to manually recompile each of those object as doing following,


  alter java class "java class object name" compile;
  but got error:
  ORA-29521: referenced name balabala could not be found


You have any advice for either how to fix this error or can we go ahead to upgrade the db with those 130 invalid objects in the sys schema safely? Thanks!
From this blog you can try this on development first...

SQL> spool resolve.sql;

SQL> select ‘alter java class “‘||object_name||’” resolve;’
  2  from user_objects
  3  where object_type like ‘%JAVA%’;

SQL> spool off;

SQL> @resolve 

The clean sweep approach would be to remove and reinstall the java JVM

The Java VM is created and populated with system classes during CREATE OR REPLACE JAVA SYSTEM command.  Run rmjvm.sql to remove the JVM first, then bounce the database then initjvm.sql

I repeat, these should be tried on your development stack first!