Missing Java Classes - Oracle Database
Recently in out UAT database our DBA had found that the component JAVAVM (JServer JAVA Virtual Machine) is invalid, and hence he did the JVM reload.
One thing he forgot was that the impact of JVM reload on existing JAVA objects in the database. Yes, all the java classes/objects got dropped due to the sudden JVM reload.
Ours is not a standalone database it has various applications running on top of using several java classes, and hence all our applications stopped working. So after a lot of trial and errors, we figured out the complete steps to fix our issue.
Query to check the java objects in the database:
a) Take a backup of $AD_TOP/admin/driver/adldjava.drv and replace all loadjava commands with below lines
loadjava csf java/jar csflf.jar
loadjava cz java/jar czdb.jar
loadjava eam java/jar eampmsch.jar
loadjava eam java/jar eamwkbch.jar
loadjava ecx java/jar ecxutils.jar
loadjava ecx java/jar ecxprocess.jar
loadjava fnd java/jar fndcct.jar
loadjava inv java/jar invdbtrx.jar
loadjava inv java/jar invlabel.jar
loadjava jtf java/jar jtfaoljdepen.zip
loadjava per java/jar perimage.jar
loadjava per java/jar perkigfclient.jar
loadjava per java/jar perkpiclient.jar
loadjava wms java/jar wmscrtzn.jar
One thing he forgot was that the impact of JVM reload on existing JAVA objects in the database. Yes, all the java classes/objects got dropped due to the sudden JVM reload.
Ours is not a standalone database it has various applications running on top of using several java classes, and hence all our applications stopped working. So after a lot of trial and errors, we figured out the complete steps to fix our issue.
Query to check the java objects in the database:
select owner , count(*) from
dba_objects where OBJECT_TYPE like '%JAVA%' group by owner;
- Oracle EBusiness Suite Application - APPS
a) Take a backup of $AD_TOP/admin/driver/adldjava.drv and replace all loadjava commands with below lines
loadjava csf java/jar csflf.jar
loadjava cz java/jar czdb.jar
loadjava eam java/jar eampmsch.jar
loadjava eam java/jar eamwkbch.jar
loadjava ecx java/jar ecxutils.jar
loadjava ecx java/jar ecxprocess.jar
loadjava fnd java/jar fndcct.jar
loadjava inv java/jar invdbtrx.jar
loadjava inv java/jar invlabel.jar
loadjava jtf java/jar jtfaoljdepen.zip
loadjava per java/jar perimage.jar
loadjava per java/jar perkigfclient.jar
loadjava per java/jar perkpiclient.jar
loadjava wms java/jar wmscrtzn.jar
b)
Rebuild
Jar files by following below steps using adadmin:
Run Adadmin
Select Generate Applications Files menu
Select Generate product JAR files
Check the adadmin log file for any errors if there is any upload logfile to SR
Run Adadmin
Select Generate Applications Files menu
Select Generate product JAR files
Check the adadmin log file for any errors if there is any upload logfile to SR
c)
Reload the jar files into database:
Run Adadmin
Select Compile/Reload Applications Database Entities menu
Select Reload JAR files to database
Check the adadmin log file for any errors if there is any upload logfile to SR
Run Adadmin
Select Compile/Reload Applications Database Entities menu
Select Reload JAR files to database
Check the adadmin log file for any errors if there is any upload logfile to SR
d)
Recompile java classes:
Run Adadmin
Select Compile/Reload Applications Database Entities menu
Select Compile APPS schema
Check the adadmin log file for any errors if there is any upload logfile to SR
Run Adadmin
Select Compile/Reload Applications Database Entities menu
Select Compile APPS schema
Check the adadmin log file for any errors if there is any upload logfile to SR
- Oracle Spatial - MDSYS
Connect as sysdba and execute the scripts
Sqlplus / as sysdba
@?\md\admin\sdoloadj.sql
exit
- Oracle Relational Data - ORDSYS
Connect as sysdba and execute the scripts
Sqlplus / as sysdba
spool load_ord_java_objects.txt
@?\ord\im\admin\initimj.sql
spool off;
exec
dbms_java.grant_permission('ORDSYS','SYS:java.util.logging.LoggingPermission',
'control', '');
exit- Oracle Warehouse Builder - OWBSYS
Connect as owbsys and perform the below
Sqlplus owbsys/<<password>> @/home/oracle/loadclasses11gr2.sql à This script can be downloaded from
the document under References.
Conn / as sysdba
begin
-- NAStart launches the name/address server
process
dbms_java.grant_permission(upper('OWBSYS'),'java.io.FilePermission',
'owb/bin/unix/NAStart.sh', 'execute');
dbms_java.grant_permission(upper('OWBSYS'),'java.io.FilePermission',
'owb/bin/win32/NAStart.bat', 'execute');
dbms_java.grant_permission(upper('OWBSYS'),'java.io.FilePermission',
'owb/bin/admin/rtrepos.properties', 'read,write');
dbms_java.grant_permission(upper('OWBSYS'),'java.io.FilePermission',
'OWB/BIN/ADMIN/RTREPOS.PROPERTIES', 'read,write');
dbms_java.grant_permission(upper('OWBSYS'),'java.io.FilePermission',
'owb/bin/unix/run_service.sh', 'read,execute');
dbms_java.grant_permission(upper('OWBSYS'),'java.io.FilePermission',
'OWB/BIN/WIN32/RUN_SERVICE.BAT', 'read,execute');
dbms_java.grant_permission(upper('OWBSYS'),'java.io.FilePermission',
'owb/bin/win32/run_service.bat', 'read,execute');
dbms_java.grant_permission(upper('OWBSYS'),
'java.util.PropertyPermission', '*', 'read,write');
dbms_java.grant_permission(upper('OWBSYS'),'java.lang.RuntimePermission','*','writeFileDescriptor');
dbms_java.grant_permission(upper('OWBSYS'),
'java.net.SocketPermission','*', 'connect');
dbms_java.grant_permission('OWBSYS','java.io.FilePermission',
'/u01/app/oracle/product/11.2.0.4/EBS/owb/lib/-','read,write,execute');
end;
/
Commit;
Conn owbsys/<<Password>>
@?/owb/rtp/sql/start_service
@?/owb/rtp/sql/service_doctor
exit
- Oracle Pharmaceutical Applications - OPA
Login to TMS Application server
Navigate to <<OPAAPPS
Location>>/tms/install
Sqlplus
opa/<<password>>@<<DBNAME>>
select object_name
from user_objects where object_type like '%JAVA%';
@opadirlist_jc
select object_name
from user_objects where object_type like '%JAVA%';
@opastringtokenizer_jc
select object_name
from user_objects where object_type like '%JAVA%';
exit;
Once all the above objects are created, recompile the entire database using standard utlrp.sql script under $ORACLE_HOME/rdbms/admin location.
Make sure all the java objects are valid, if any java objects are still invalid, raise an SR with oracle to get it fixed.
References
- Reinstalling Spatial Java Class objects after Reloading JVM (Doc ID 1283861.1)
- How To Reload Java Classes Into The OWB 11.2 Unified Repository (Doc ID 1493697.1)
- Missing ORDSYS JAVA classes after JVM has been re-installed (Doc ID 1474703.1)
- FNDCPASS fails with ORA-29540... USER ( APPS ) has been detected in FND_WEB_SEC.GET_OP_VALUE (Doc ID 2180338.1)
Thank you for sharing this useful information.
ReplyDeleteOracle Training in Chennai | Oracle Course in Chennai