A quick solution of (ORA-29540: class [class_name] does not exist) may be, using “-synonym” keyword while loading java into database.
For instance if you use following command, you may get the error.
loadjava -u sys/pwd -verbose -grant PUBLIC log4j.properties
A solution maybe :
loadjava -u sys/sysadm -verbose -synonym -grant PUBLIC log4j.properties