My Oracle Support Banner

Ora-29540 When Executing a Java Stored Procedure (Doc ID 376879.1)

Last updated on MARCH 14, 2025

Applies to:

Oracle Database - Enterprise Edition - Version 9.2.0.7 and later
Information in this document applies to any platform.

Symptoms

Getting "ORA-29540: class TestInsert does not exist" error when referencing a java stored procedure:

TestInsert.java
--------------------
package TestInsert;
import java.sql.*;
public class TestInsert
{
public static void main(String[] args)
throws ClassNotFoundException, SQLException
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@<ipaddress>:<portnumber>:EMB920W6", "scott", "tiger");
Statement stmt = conn.createStatement();
int numRows = stmt.executeUpdate("INSERT INTO test VALUES ('hello world')");
conn.close();
}
}

SQL> CREATE OR REPLACE PROCEDURE "TEST_PROC" as language java name 'TestInsert.main(java.lang.String[])';
2 /

Procedure created.

SQL> EXEC TEST_PROC
BEGIN TEST_PROC; END;

*
ERROR at line 1:
ORA-29540: class TestInsert does not exist
ORA-06512: at "SCOTT.TEST_PROC", line 0
ORA-06512: at line 1

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.