Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Wednesday, November 9, 2011

ORA-29540: class oracle/plsql/net/TCPConnection does not exist


Problem Description

When attempting to run the packages UTL_SMTP, and UTL_TCP, an error is returned indicating that the class oracle/plsql/net/TCPConnection does not exist.  This class, along with others that support SQLJ functionality, should normally be loaded when the "initjvm.sql" script is run. 
However, that script has already been run successfully, to completion.

ORA-29540: class oracle/plsql/net/TCPConnection does not exist

Solution Description

The initjvm.sql script (located in the ORACLE_HOME/javavm/install directory) is run automatically during normal installation of the database, except during custom installation.  In any event, thescript can be run manually (as SYS) at a later time. When this script is run, approximately 8000+ java classes are loaded into the database. 

Unfortunately, there is another script, initplsj.sql (located in ORACLE_HOME/rdbms/admin) which is supposed to be called by the initjvm.sql script. This does not occur. To fix the problem, runthe initplsj.sql script (as SYS).  You will note that 200+ classes get loaded into the database as a result of this script. 

This should then allow you to use the UTL_SMTP and UTL_TCP packages.

This script also needs to be run:

$ORACLE_HOME/javavm/install/init_security.sql

Source: Oracle Metalink