ORA-29538:Java not installed

the developer meets the error message as trying to create a java object using sqlplus:

*****************************************
ORA-29538: Java not installed
*****************************************

//I double that the jvm components is not installed in oracle,check it out..

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> set linesize 160
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

SQL> select host_name,instance_name from v$instance;

HOST_NAME                                                  INSTANCE_NAME
---------------------------------------------------            ----------------
RLJXDBSCBG                                                      orcl

SQL> select distinct owner,name from dba_source where lower(NAME)='dbms_java';

no rows selected

//check the installed components

SQL> select comp_name, version, status from dba_registry;
 COMP_NAME                          VERSION                       STATUS
 ------------------------- ------------------------------ ----------------------
 Oracle Enterprise Manager                  11.2.0.1.0                   VALID
 Oracle Workspace Manager                   11.2.0.1.0                   VALID
 Oracle Database Catalog Views              11.2.0.1.0                  VALID
 Oracle Database Packages and Types          11.2.0.1.0                  VALID

//find another db based on 10205 and check the name ‘dbms_java’ in dba_source view

SQL> select distinct owner,name from dba_source where lower(NAME)=’dbms_java’;

OWNER NAME
————————–      ——————————
SYS                                    DBMS_JAVA
// the dbms_java has been installed

//check the installed components

SQL> select comp_name,version,status from dba_registry;

COMP_NAME                              VERSION                    STATUS
------------------------------------ ---------------------    ----------------
Oracle Database Catalog Views         10.2.0.5.0                  VALID
Oracle Database Packages and Types    10.2.0.5.0                  VALID
Oracle Workspace Manager              10.2.0.5.0                  VALID
JServer JAVA Virtual Machine          10.2.0.5.0                  VALID
Oracle XDK                            10.2.0.5.0                  VALID
Oracle Database Java Packages         10.2.0.5.0                  VALID
Oracle Expression Filter              10.2.0.5.0                  VALID
Oracle Data Mining                    10.2.0.5.0                  VALID
Oracle Text                           10.2.0.5.0                  VALID
Oracle XML Database                   10.2.0.5.0                  VALID
Oracle Rules Manager                  10.2.0.5.0                  VALID

COMP_NAME                                  VERSION            STATUS
-------------------------              ----------------     ----------------------
Oracle interMedia                       10.2.0.5.0               VALID
OLAP Analytic Workspace                 10.2.0.5.0               VALID
Oracle OLAP API                         10.2.0.5.0               VALID
OLAP Catalog                            10.2.0.5.0               VALID
Spatial                                 10.2.0.5.0               VALID
Oracle Enterprise Manager               10.2.0.5.0               VALID

//it’s easy seen that there is the “JServer JAVA Virtual Machine” in 10205 environment

//you can execute the java code in sqlplus as below:

*****************************************************************
……………………..
251 {
252 javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance( “DES” );
253 cipher.init( javax.crypto.Cipher.DECRYPT_MODE, key );
254 java.io.InputStream is = new java.io.FileInputStream( file );
255 java.io.OutputStream out = new java.io.FileOutputStream( dest );
256 javax.crypto.CipherOutputStream cos = new javax.crypto.CipherOutputStream( out, cipher );
257 byte[] buffer = new byte[1024];
258 int r;
259 while ( ( r = is.read( buffer ) ) >= 0 )
260 {
261 cos.write( buffer, 0, r );
262 }
263 cos.close();
264 out.close();
265 is.close();
266 }
267 }
268
269
270 /

Java created.

************************************************************

Now,We can locate the root cause of this case.It’s the lack of jvm in oracle which cause the failure of create java object in sqlplus.

We should install the jvm by running initjvm.sql in $ORACLE_HOME/javavm/install/

//you can see the “JServer JAVA Virtual Machine” is loading….

SQL> select comp_name, version, status from dba_registry

COMP_NAME                             VERSION                      STATUS
--------------------------------- ------------------------------ ----------------------
Oracle Enterprise Manager           11.2.0.1.0                     VALID
Oracle Workspace Manager            11.2.0.1.0                     VALID
Oracle Database Catalog Views       11.2.0.1.0                     VALID
Oracle Database Packages and Types  11.2.0.1.0                     VALID
JServer JAVA Virtual Machine                                      LOADING

//Couple of minutes later,finally,the component goes to valid

SQL> select comp_name, version, status from dba_registry

COMP_NAME                             VERSION                  STATUS

 ---------------------------- ---------------------- ---------------------
Oracle Enterprise Manager             11.2.0.1.0                VALID
Oracle Workspace Manager              11.2.0.1.0                VALID
Oracle Database Catalog Views         11.2.0.1.0                VALID
Oracle Database Packages and Types    11.2.0.1.0                VALID
JServer JAVA Virtual Machine          11.2.0.1.0                VALID

The problem was solved

–EOF–