Missing Defines Error in Simple Java Stored Procedure

Anyone have any suggestions on what might be causing the unusual behavior described below? Could it be a 10g java configuration issue? I am really stuck so I'm open to just about anything. Thanks in advance.
I am writing a java stored procedure and am getting some SQLException's when executing some basic JDBC code from within the database. I reproduced the problem by writing a very simple java stored procedure which I have included below. The code executes just fine when executed outside of the database (10g). Here is the output from that execution:
java.class.path=C:\Program Files\jEdit42\jedit.jar
java.class.version=48.0
java.home=C:\j2sdk1.4.2_04\jre
java.vendor=Sun Microsystems Inc.
java.version=1.4.2_04
os.arch=x86
os.name=Windows XP
os.version=5.1
In getConnection
Executing outside of the DB
Driver Name = Oracle JDBC driver
Driver Version = 10.1.0.2.0
column count=1
column name=TEST
column type=1
TEST
When I execute it on the database by calling the stored procedure I get:
java.class.path=
java.class.version=46.0
java.home=/space/oracle/javavm/
java.vendor=Oracle Corporation
java.version=1.4.1
os.arch=sparc
os.name=Solaris
os.version=5.8
In getConnection
We are executing inside the database
Driver Name = Oracle JDBC driver
Driver Version = 10.1.0.2.0
column count=1
column name='TEST'
column type=1
MEssage: Missing defines
Error Code: 17021
SQL State: null
java.sql.SQLException: Missing defines
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:158)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
at oracle.jdbc.driver.OracleResultSetImpl.getString(Native Method)
at OracleJSPTest.test(OracleJSPTest:70)
Here is the Java code:
// JDBC classes
import java.sql.*;
import java.util.*;
//Oracle Extensions to JDBC
import oracle.jdbc.*;
import oracle.jdbc.driver.OracleDriver;
public class OracleJSPTest {
private static void printProperties(){
     System.out.println("java.class.path="+System.getProperty("java.class.path"));
     System.out.println("java.class.version="+System.getProperty("java.class.version"));
     System.out.println("java.home="+System.getProperty("java.home"));
     System.out.println("java.vendor="+System.getProperty("java.vendor"));
     System.out.println("java.version="+System.getProperty("java.version"));
     System.out.println("os.arch="+System.getProperty("os.arch"));
     System.out.println("os.name="+System.getProperty("os.name"));
     System.out.println("os.version="+System.getProperty("os.version"));
private static Connection getConnection() throws SQLException {
     System.out.println("In getConnection");      
Connection connection = null;
// Get a Default Database Connection using Server Side JDBC Driver.
// Note : This class will be loaded on the Database Server and hence use a
// Server Side JDBC Driver to get default Connection to Database
if(System.getProperty("oracle.jserver.version") != null){
          System.out.println("We are executing inside the database");
          //connection = DriverManager.getConnection("jdbc:default:connection:");                    
          connection = new OracleDriver().defaultConnection();
}else{
     System.out.println("Executing outside of the DB");
     DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
     connection = DriverManager.getConnection("jdbc:oracle:thin:@XXX.XXX.XXX.XX:XXXX:XXXX","username","password");
DatabaseMetaData dbmeta = connection.getMetaData();
System.out.println("Driver Name = "+ dbmeta.getDriverName());
System.out.println("Driver Version = "+ dbmeta.getDriverVersion());
return connection;
public static void main(String args[]){     
     test();     
public static void test() {   
     printProperties();
Connection connection = null; // Database connection object
try {
     connection = getConnection();
     String sql = "select 'TEST' from dual";
     Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(sql);     
     ResultSetMetaData meta = rs.getMetaData();     
     System.out.println("column count="+meta.getColumnCount());
     System.out.println("column name="+meta.getColumnName(1));
     System.out.println("column type="+meta.getColumnType(1));
     if(rs.next()){
          System.out.println(rs.getString(1));
} catch (SQLException ex) { // Trap SQL Errors
     System.out.println("MEssage: " + ex.getMessage());
     System.out.println("Error Code: " + ex.getErrorCode());
     System.out.println("SQL State: " + ex.getSQLState());
     ex.printStackTrace();
} finally {
try{
if (connection != null || !connection.isClosed())
connection.close(); // Close the database connection
} catch(SQLException ex){
ex.printStackTrace();
Message was edited by:
jason_mac

Jason,
Works for me on Oracle 10.1.0.3 running on Red Hat Enterprise Linux AS release 3 (Taroon).
Java code:
import java.sql.*;
* Oracle Java Virtual Machine (OJVM) test class.
public class OjvmTest {
  public static void test() throws SQLException {
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    PreparedStatement ps = null;
    ResultSet rs = null;
    try {
      ps = conn.prepareStatement("select 'TEST' from SYS.DUAL");
      rs = ps.executeQuery();
      if (rs.next()) {
        System.out.println(rs.getString(1));
    finally {
      if (rs != null) {
        try {
          rs.close();
        catch (SQLException sqlEx) {
          System.err.println("Error ignored. Failed to close result set.");
      if (ps != null) {
        try {
          ps.close();
        catch (SQLException sqlEx) {
          System.err.println("Error ignored. Failed to close statement.");
}And my PL/SQL wrapper:
create or replace procedure P_J_TEST as language java
name 'OjvmTest.test()';And here is how I execute it in a SQL*Plus session:
set serveroutput on
exec dbms_java.set_output(2000)
exec p_j_testGood Luck,
Avi.

Similar Messages

  • No method found error when calling java stored procedured

    hi:
    i am rather confused about this. i have written several
    java stored procedures and all of them work fine. but when i tried another one , the error message 'no method found 'occurs
    when i call the procedure from sqlplus.
    it' s a simple procedure . but it's very strange and happens
    from time to time
    my compile shell as following
    javac -classpath $ORACLE_HOME/jdbc/lib/classes12.zip GenFiles.java
    $ORACLE_HOME/bin/loadjava -u zw/zw@aixtest GenFiles.class
    and
    my definition as following
    create or replace procedure files(chargeCyckeID varchar2, cycleStart varchar2,cycleEnd varchar2,
    loginName varchar2, filePath varchar2, start1 number, end1 number, step number)
    AS LANGUAGE JAVA
    NAME 'GenFiles.genFile(String , String , String , String , String , int , int , int )';
    and my java code is here :
    import java.sql.*;
    import java.io.*;
    import oracle.jdbc.driver.*;
    public class GenFiles{
         public static void main(String[] args){
              04UU<F7QV\FZ#,V\FZ?*J<#,V\FZ=aJx#,5GB<C{#, ND<~B7>6#,Pr:E?*J<#,Pr:E=aJx#,2=3$#(Iz3IND<~5D<GB<J}#)
         public static void genFile(String chargeCycleID, String cycleStart, String cycleEnd, String loginName, String filePath, int start, int end, int step){
         try{
              String sqllist = "select customer_id,contract_code,     usercode,ani,ord,"
                        + " agent_code,linkman, customer_name , postcode,paymethod_category_id ,"
                        + " ltrim(to_char(cost,'999999990.99')) cost,call_duration,from listani_file where ord> ? and ord<? order by contract_code";
              String sqlcalls1 = "select a.ani || ',' || a.PASS || ',' || to_char(a.START_TIME,'yyyy-mm-dd hh24:mi:ss') stime || ',' || trunc(a.CALL_DURATION/60)||':'||ltrim(to_char(mod(a.CALL_DURATION,60),'09')) CALL_DURATION || ',' || ltrim(to_char((CALL_AMOUNT/ceil(CALL_DURATION/60)),'999999990.99')) RATE || ',' || ltrim(to_char(a.CALL_AMOUNT,'999999990.99')) CALL_AMOUNT"
                        +" from call_fact_mind a "
                        +" where a.usercode=?"
                        + " and a.ani=? "
                        + " and a.period_key<='" + end + "'"
                        + " and a.period_key>='" + start + "'"
                        + " and a.charge_flag='Y' "
                        + " and a.CALL_DURATION>6"
                        + " and a.CALL_AMOUNT>0"
                        +" order by a.period_key";                    
              String sqlcalls2 = "select a.ani || ',' || a.PASS || ',' || to_char(a.START_TIME,'yyyy-mm-dd hh24:mi:ss') stime || ',' || trunc(a.CALL_DURATION/60)||':'||ltrim(to_char(mod(a.CALL_DURATION,60),'09')) CALL_DURATION || ',' || ltrim(to_char((CALL_AMOUNT/ceil(CALL_DURATION/60)),'999999990.99')) RATE || ',' || ltrim(to_char(a.CALL_AMOUNT,'999999990.99')) CALL_AMOUNT "
                        + " from call_fact_mind a "
                        + " where a.usercode=?"
                        + " and a.period_key<='" + end + "'"
                        + " and a.period_key>='" + start + "'"
                        + " and a.charge_flag='Y' "
                        + " and a.CALL_DURATION>6"
                        + " and a.CALL_AMOUNT>0"
                        +" order by a.period_key";                    
              Connection con = new OracleDriver().defaultConnection();
              try{
                   int i = start;
                   //8y>]2=3$Q-;7
                   while( true){
                        if( i>=end ) break;
                        genFile(con, i , i+step, chargeCycleID, loginName, filePath, sqllist, sqlcalls1, sqlcalls2);
                        i += step;
              }catch(Exception ex){
              }finally{
                   if( con != null) con.close();
         }catch(Exception exx){}
              8y>]2=3$Iz3IND<~
         private static void genFile(Connection con, int start, int end, String chargeCycleID, String loginName, String filePath, String sqllist, String sqlcalls1, String sqlcalls2) throws Exception{
              PreparedStatement ps1 = null;
              PreparedStatement ps2 = null;
              PreparedStatement ps3 = null;
              ResultSet rs1 = null;
              ResultSet rs2 = null;
              String fileName = filePath + System.getProperty("file.separator") + start + "_" + end + ".txt";
              BufferedWriter writer = null;
              try{
                   writer = new BufferedWriter(new FileWriter(fileName));
                   ps1 = con.prepareStatement(sqllist);
                   ps2 = con.prepareStatement(sqlcalls1);
                   ps3 = con.prepareStatement(sqlcalls2);
                   ps1.setInt(1, start);
                   ps1.setInt(2, end);
                   rs1 = ps1.executeQuery();
                   //Iz3Ibuffer,V;SPR;6(<GB<J12EP4HkND<~
                   StringBuffer strBuffer = new StringBuffer();
                   int i =0;
                   //Q-;7:OM,=a9{</
                   String preContractCode = "";
                   String currentContractCode = "";
                   while( rs1.next()){
                        currentContractCode = rs1.getString("contract_code");
                        if( rs1.getString("ani") == null){
                             ps2.setString( 1, rs1.getString("usercode"));
                             rs2 = ps2.executeQuery();
                        }else{
                             ps1.setString(1, rs1.getString("usercode"));
                             ps1.setString(2, rs1.getString("ani"));
                             rs2 = ps1.executeQuery();
                        //Hg9{3vOVPB5D:OM,:E#,<SHk:OM,OnM7,contract_costJG:OM,On7QSC
                        if( ! preContractCode.equals(currentContractCode)){                     
                             //TZG0Cf<SHk?UPP
                             strBuffer.append("\r\n");
                             String contractHead = "\"1\"" + ",\"" + rs1.getString("linkman") + "\",\"" + rs1.getString("customer_name")
                                            + "\",\"" + rs1.getString("contract_code") + "\",\"" + rs1.getString("agent_code")
                                            + "\",\"" + chargeCycleID + "\",\"" + rs1.getString("contract_cost") + "\"";
                             strBuffer.append(contractHead);
                        while( rs2.next()){
                             if( i<1000){
                                  i++;
                                  strBuffer.append("\"2\"" + rs2.getString(1));
                             }else{
                                  String str = strBuffer.toString();
                                  writer.write(str, 0, str.length());
                                  strBuffer = new StringBuffer();
                                  strBuffer.append(rs2.getString(1));
                                  i = 1;
                        //<SHk7QSC:O<F
                        if( rs1.getString("ani") == null){
                             String trail = "\"2\"" + ",\"" + "ani: " + "\",\"" + rs1.getString("ani") + "\",\"" + "Total Amount: " + "\",\"" + rs1.getString("cost") + "\"\r\n";
                             strBuffer.append(trail);
                        }else{
                             String trail = "\"2\"" + ",\"" + "usercode: " + "\",\"" + rs1.getString("usercode") + "\",\"" + "Total Amount: " + "\",\"" + rs1.getString("cost") + "\"\r\n";
                             strBuffer.append(trail);
                        preContractCode = currentContractCode;     
                        writer.close();
                        rs2.close();
              }catch(Exception ex){
              }finally{
                   if( rs1 != null) rs1.close();
                   if( rs2 != null) rs2.close();
                   if( ps1 != null) ps1.close();
                   if( ps2 != null) ps2.close();
    i need your help!
    regards
    daniel wang

    Hi again, Daniel,
    I'm only guessing here, but unless you've made lots of mistakes when
    you copied your code to your post to the forum, your method signatures
    don't match. The definition of "genFile" in your java class is quite
    different to what you wrote in your PL/SQL wrapper.
    Also, you have defined "genFile" to be a private method -- I think it
    needs to be public.
    Also, I think the "main" method doesn't need to be in the "GenFiles"
    class -- perhaps you should remove it.
    Also, I think in your PL/SQL wrapper you need to use fully qualified
    names, so use "java.lang.String" and not just "String".
    Lastly, I think you should use the "-force" and "-resolve" flags
    with the "loadjava" command.
    Good Luck,
    Avi.

  • Error while executing java stored procedure from a pl/sql procedure

    We have a requirement where we need to execute JAVA code stored in an Oracle database (Java Stored Procedure). This code uses some JAR files which we have already loaded without any errors in the database.
    The class file was also loaded in the database without any errors. But when we execute the method of this class (JAVA code), it gives the following error:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NoClassDefFoundError
    Is there any way of debugging the code and getting to know where exactly the problem is? Or, any tool/software available for doing the same.
    Any pointers would be of great help!
    Thanks in advance

    Hi Uday,
    My guess is that there is a problem with your java stored procedure that is causing the "ExceptionInInitializer" error to be thrown. According to the javadoc:
    is thrown to indicate that an exception occurred during
    evaluation of a static initializer or
    the initializer for a static variable
    Since I didn't see any of your code in your post, I can't help you much more, I'm afraid. Perhaps if you would provide some more details, I may be able to help you some more. I think the following details would be helpful:
    1. Complete error message and stack trace you are getting.
    2. The section of your java code that you think is causing the problem.
    3. Oracle database version you are using.
    Good Luck,
    Avi.

  • Error while executing Java Stored Procedure.

    Hi,
    When I'm trying to execute my java stored procedure i'm getting the following error:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.ExceptionInInitializerError
    Does anybody has idea why this error comes and how can be resolved.
    Thanks in advance.
    Uday

    Hi Uday,
    My guess is that there is a problem with your java stored procedure that is causing the "ExceptionInInitializer" error to be thrown. According to the javadoc:
    is thrown to indicate that an exception occurred during
    evaluation of a static initializer or
    the initializer for a static variable
    Since I didn't see any of your code in your post, I can't help you much more, I'm afraid. Perhaps if you would provide some more details, I may be able to help you some more. I think the following details would be helpful:
    1. Complete error message and stack trace you are getting.
    2. The section of your java code that you think is causing the problem.
    3. Oracle database version you are using.
    Good Luck,
    Avi.

  • How to implement simple java stored procedure

    I'm using Maxdb  7. 6.03.15 (standalone - no SAP) as a Migration Environment to a new centralized SAP solution.
    Most of the work is done in internal DBproc but I need to trig external procedure (those one's written in Java).
    I have already spent too much time to find related information and because I need only very simple triggreing, I don't want to learn and deploy product like NetWeaver ... anyone could give me minimal information on how to do that ...
    If I'm right, I need to configure the MessageServer and develop a minimist java proc that should be able to register the DBproc (java language) inside DB and handle the MessageServer msg generated by my internal DBproc call to the newly registered java proc ?
    I just want to do that as simple as possible, I don't need locking scheme neither multiple request queue ... because I control all access to the DB and all process are completely serialized  (It was a design rule).
    Could anyone help me ?

    Thank's Lars for that quick answer !
    You wrote,
    > AFAIK one development target is to implement UDEs (User Defined Extensions) that will allow the creation of "inside-the-db-code" in >other languages than the one used for the stored procedures.
    did you mean "JavaUdeServer" ? I see some interesting code in source tree about that . I investigate a little about but I miss the binary javaUdeServer code (and I don't want to rebuild the distribution also because of different version). The message returned when I tried to call a registered java stored proc was smoething like 'Impossible to contact UDE server' 
    But the code is still embedded in the kernel (as It can be found in the map files).
    I don't find any documentation on that feature ,is it for security reason ? If so  I'm ready for a 'No disclosure agreement' (It's not a personal request).
    Of course, if the only way is NetWeaver that could be OK but the task seem's to me so heavy regarding my so simple need's  ... if there is a short way (samples ?) to kick me on NetWeaver to reach my goal you're welcome !!
    (Some piece of code on NetWeaver that allow a procedure to call to external java proc that return hostname will be enough ...).
    For you information, (because I have the feeling I got your answer) I already install a trial NetWeaver some week's ago but I don't spent (and I don't have) many times to use It and I have the bad sensation to try driving a big truck only to move a cup of coffee ...(of Java of course !) but perhaps I'm too impatient ?
    Regards,
    Michel

  • Publishing JSP form JAVA stored procedure [Oracle8i 8.1.7]

    Hi folks,
    I wonder if anybody knows a way to publish JSP from JAVA stored procedure.
    I know there is a way to load java class using PL/SQL package DBMS_JAVA.loadjava(), or
    oracle.aurora.server.tools.loadjava.LoadJavaMain.serverMain() from java.
    But I need somthing like publishjsp to translate the JSP.
    Also would be nice if I can invoke this from a LOB where I have stored my JSP.
    Any ideas?
    Mitko

    I case anyone is interested.
    I managed to find out what I was doing wrong.
    First when you call a stored procedure that is in a package and is a method of a class. You call it referencing the packagename.method. Leaving out the class name. Also, since this was a method that returns a value. The return value has to be assigned to a variable or used in an sql statement. Such as:
    var x number;
    call claimsprocedures.ip(19990033) into :x;call completed
    print x;(then the value is displayed in sql*plus
    scirco.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by scirco:
    I created a simple java stored procedure and depoloyed it using the deployment wizard. The code for the class is as follows:
    // Copyright (c) 2000 CAP-MPT
    package ClaimsProcedures;
    import sqlj.runtime.*;
    import sqlj.runtime.ref.*;
    import java.sql.*;
    import java.sql.SQLException;
    * A Sqlj class.
    * <P>
    * @author Sebastian Circo
    public class ClaimsFinancialHistory extends Object {
    * Constructor
    public ClaimsFinancialHistory() {
    public static int IP(int Claimno) throws SQLException {
    int Val;
    Val = 0;
    #sql {select sum(amount) into :Val from reshist
    where claimno = :Claimno and type = 'RI'};
    return Val;
    The wizard indicated that everything deployed properly. However when I try to call the procedure/method "IP" from sql*plus I get the following message: ORA-06576: not a valid function or procedure name. I double checked to make sure that I'm publishing the "IP" method and I still get the same error. I also tried calling the procedure with the schema.class.procedure form, still same error.
    Can anyone help?
    thanks
    scirco<HR></BLOCKQUOTE>
    null

  • Java stored procedures in 8.1.6

    I created a simple java stored procedure and depoloyed it using the deployment wizard. The code for the class is as follows:
    // Copyright (c) 2000 CAP-MPT
    package ClaimsProcedures;
    import sqlj.runtime.*;
    import sqlj.runtime.ref.*;
    import java.sql.*;
    import java.sql.SQLException;
    * A Sqlj class.
    * <P>
    * @author Sebastian Circo
    public class ClaimsFinancialHistory extends Object {
    * Constructor
    public ClaimsFinancialHistory() {
    public static int IP(int Claimno) throws SQLException {
    int Val;
    Val = 0;
    #sql {select sum(amount) into :Val from reshist
    where claimno = :Claimno and type = 'RI'};
    return Val;
    The wizard indicated that everything deployed properly. However when I try to call the procedure/method "IP" from sql*plus I get the following message: ORA-06576: not a valid function or procedure name. I double checked to make sure that I'm publishing the "IP" method and I still get the same error. I also tried calling the procedure with the schema.class.procedure form, still same error.
    Can anyone help?
    thanks
    scirco

    I case anyone is interested.
    I managed to find out what I was doing wrong.
    First when you call a stored procedure that is in a package and is a method of a class. You call it referencing the packagename.method. Leaving out the class name. Also, since this was a method that returns a value. The return value has to be assigned to a variable or used in an sql statement. Such as:
    var x number;
    call claimsprocedures.ip(19990033) into :x;call completed
    print x;(then the value is displayed in sql*plus
    scirco.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by scirco:
    I created a simple java stored procedure and depoloyed it using the deployment wizard. The code for the class is as follows:
    // Copyright (c) 2000 CAP-MPT
    package ClaimsProcedures;
    import sqlj.runtime.*;
    import sqlj.runtime.ref.*;
    import java.sql.*;
    import java.sql.SQLException;
    * A Sqlj class.
    * <P>
    * @author Sebastian Circo
    public class ClaimsFinancialHistory extends Object {
    * Constructor
    public ClaimsFinancialHistory() {
    public static int IP(int Claimno) throws SQLException {
    int Val;
    Val = 0;
    #sql {select sum(amount) into :Val from reshist
    where claimno = :Claimno and type = 'RI'};
    return Val;
    The wizard indicated that everything deployed properly. However when I try to call the procedure/method "IP" from sql*plus I get the following message: ORA-06576: not a valid function or procedure name. I double checked to make sure that I'm publishing the "IP" method and I still get the same error. I also tried calling the procedure with the schema.class.procedure form, still same error.
    Can anyone help?
    thanks
    scirco<HR></BLOCKQUOTE>
    null

  • Problem In creating Java stored procedure- Urgent

    Hi Guys,
    I try to create a simple Java stored procedure but I get the following error message. Can you help me to sort out the problem please?.
    SQL> create or replace and compile java source named "Hello"
    2 as
    3 public class Hello {
    4 public static String hello()
    5 {
    6 return "Hello Oracle World";
    7 }
    8 }
    9 /
    Warning: Java created with compilation errors.
    SQL> show error java source Hello;
    No errors.
    Thanks in advance
    anthony
    null

    I had a similar issue, the reason for that was picking the incorrect partner link.
    Make sure the name of the selected partner link in the invoke output variable is matching with the Assign, in you case lets say you mapped the
    Invoke
    output variable is invoke_1_CallStoredProcedure_OutputVariable ( not nvoke_1_CallStoredProcedure_OutputVariable_1)
    From
    <Invoke_1_CallStoredProcedure_OutputVariable>
    <LF_STATUS>
    To
    P_lf_status ( variable)
    most of the time multiple variables are created when we try to select the output variable s in the Invoke.

  • Error deploying java stored procedure

    Anyway, I've got a really simple java function that takes an XML document in a CLOB as a parameter and simply returns whether or not it's a valid document. Works fine in JDeveloper, but when I try to load it into the database, I get:
    Errors in cdh_j_validate:
    ORA-29521: referenced name oracle/xml/parser/v2/DOMParser could not be found
    The XML Parser is installed on the database and is functioning properly.. I am deploying my Java stored procedure to the same schema that the xml parser was installed into. Any suggestions?
    Thanks in advance,
    Craig Drabik
    null

    This is due to a current restriction in the loadjava utility. The following is the excerpt from the Release notes on the subject:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
    Incomplete Deployment to Oracle8i When Using JDBC Thin Driver and Net8 Name-value List (1250825)
    In the Connection Manager, it is possible to create a connection to Oracle 8i using the Oracle JDBC Thin driver and Net8 name-value pairs as the connection method. This connection can be viewed in the Database Browser, but deployment will not complete because the loadjava utility requires a database string of the form "@host:port:SID" when using the Oracle JDBC Thin driver.
    There are two work-arounds to this problem:
    Use the Named Host connection method instead of Net Name-Value Pair when creating this connection type in the Connection Manager.
    Use the Oracle JDBC OCI-8 driver instead of the Oracle JDBC Thin driver. To use the Oracle JDBC OCI-8 driver with JDeveloper, please see the section entitled 'Connection Requirements for OCI and Type 2 JDBC Drivers' in the online documentation.
    <HR></BLOCKQUOTE>
    -- Brian

  • Error while deploying a Java Stored Procedure using JDeveloper

    Hi,
    I was going thru the Oracle By Example article: "Developing SQL and PL/SQL with JDeveloper". (http://www.oracle.com/technology/obe/obe9051jdev/ide1012/plsqlobe/obeplsql.htm)
    One of the items in this article is - "Creating and Deploying a Java Stored Procedure"
    I was able to create a java class, compile it. Created a deployment profile. created a pl/sql wrapper. While trying to deploy the java stored procedure, I am getting the following error:
    Invoking loadjava on connection 'hr_conn' with arguments:
    -order -resolve -thin
    errors : class package1/mypackage/JavaStoredProc
    ORA-29521: referenced name java/lang/StringBuilder could not be found
    The following operations failed
    class package1/mypackage/JavaStoredProc: resolution
    oracle.aurora.server.tools.loadjava.ToolsException: Failures occurred during processing
         at oracle.aurora.server.tools.loadjava.LoadJava.process(LoadJava.java:863)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:116)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:46)
         at oracle.jdevimpl.deploy.OracleDeployer.deploy(OracleDeployer.java:97)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:474)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:361)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:285)
         at oracle.jdevimpl.deploy.StoredProcProfileDt$Action$1.run(StoredProcProfileDt.java:383)
    #### Deployment incomplete. #### Oct 27, 2005 1:38:56 PM
    Appreciate your help on this..

    I am using Jdeveloper 10.1.3 Early Access Version. JDK comes with it. I also have another JDK on my machine (JDK1.4.2_09)

  • Calling the Java Method in PL/SQL Java Stored procedure errors out

    Hi,
    I could not find a suitable thread to post my PL/SQL question so iam posting it here.........
    I have written a java class by name XYZ which has a method ABC for which there are 9 arguements being passed and its a VOID method.
    This java class has been loaded into ORACLE using DBMS_JAVA.LOADJAVA pkg, Now this class is being called in the oracle as a JAVA Stored procedure...... When ever im trying to call the procedure it throws the following error
    ORA-29531: no method
    *Cause:    An attempt was made to execute a non-existent method in a
    Java class.
    *Action:   Adjust the call or create the specified method.
    The code snippet as follows
    JAVA CODE:
    Class xyz
    public static void Abc (String hostName,
    int port,
    String serviceURL,
    String soapAction,
    int timeOut,
    String wsUser,
    String wsPasWd,
    String keyStore,
    String keyStorePasWd)
    //method implementation
    JAVA STORED PROCEDURE:
    create OR REPLACE procedure ABC_JAVA_SP_CALL
    (p_hostname in varchar2, p_port in number, p_serviceurl in varchar2, p_soapaction in varchar2, p_timeout in number, p_wsuser in varchar2, p_wspasswd in varchar2, p_ks_path in varchar2, p_ks_passwd in varchar2)
    as
    language java
    name 'xyz.Abc(java.lang.String, int, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String)';
    When i try to call
    declare
    p_hostname varchar2(100);
    p_port number;
    p_serviceurl varchar2(100);
    p_soapaction varchar2(100);
    p_timeout number;
    p_wsuser varchar2(100);
    p_wspasswd varchar2(100);
    p_ks_path varchar2(100);
    p_ks_passwd varchar2(100);
    begin
    //SP which returns the values for the required parameters.
    comppkg.getvcsinfo(
    p_hostname,
    p_port ,
    p_serviceurl,
    p_soapaction,
    p_timeout,
    p_wsuser,
    p_wspasswd,
    p_ks_path,
    p_ks_passwd
    Layer7_icengc_ws_tes(p_hostname,
    p_port ,
    p_serviceurl,
    p_soapaction,
    p_timeout,
    p_wsuser,
    p_wspasswd,
    p_ks_path,
    p_ks_passwd);
    end;
    This thing ends up with
    29531. 00000 - "no method %s in class %s"
    *Cause:    An attempt was made to execute a non-existent method in a
    Java class.
    *Action:   Adjust the call or create the specified method.
    Im not understanding what wrong am i doing
    pls help
    Edited by: madhusudan on Feb 12, 2013 8:07 PM

    Hello,
    there is the forum {forum:id=65} for questions about using Java within Oracle.
    Regards
    Marcus
    Edited by: Marwim on 13.02.2013 07:56
    I could not find a suitable thread to post my PL/SQL question so iam posting it here.........You got the hint to the correct forum alread in another thread {message:id=10837976}
    And if you think this is not related to Java but PL/SQL, then you should ask in {forum:id=75}

  • NameFromLastDDL Error during java stored procedure upload...

    Hi guys,
    I am trying to upload a class to send email within a java stored procedure.
    JDeveloper fails to upload the class, and the error message doesn't help me:
    I guess the automatically generated SQL statment features a "NameFromLastDDL" argument, but i have no control over that....anybody had this issue before ?
    Following, the "ugly" exception:
    Error while creating class client/Utils
    ORA-06550: line 1, column 91:
    PLS-00201: identifier 'NameFromLastDDL' must be declared
    ORA-06550: line 1, column 85:
    PL/SQL: Statement ignored
    java.sql.SQLException: ORA-06550: line 1, column 91:
    PLS-00201: identifier 'NameFromLastDDL' must be declared
    ORA-06550: line 1, column 85:
    PL/SQL: Statement ignored
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:184)
         at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:873)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3076)
         at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4273)
         at oracle.aurora.server.tools.loadjava.ClientClassObject.create(ClientClassObject.java:68)
         at oracle.aurora.server.tools.loadjava.SchemaObject.process1(SchemaObject.java:223)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:530)
         at oracle.aurora.server.tools.loadjava.LoadJava.addClass(LoadJava.java:584)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:434)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:378)
         at oracle.aurora.server.tools.loadjava.LoadJava.addJar(LoadJava.java:717)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:430)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:378)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:347)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:643)
         at oracle.aurora.server.tools.loadjava.LoadJava.processDeferredFiles(LoadJava.java:615)
         at oracle.aurora.server.tools.loadjava.LoadJava.process(LoadJava.java:806)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:116)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:46)
         at oracle.jdevimpl.deploy.OracleDeployer.deploy(OracleDeployer.java:97)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:473)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:360)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeployToMostRecent(StoredProcHandler.java:256)
         at oracle.jdevimpl.deploy.StoredProcProfileDt$2.run(StoredProcProfileDt.java:193)
    The following operations failed
    class client/Utils: creation (createFailed)
    oracle.aurora.server.tools.loadjava.ToolsException: Failures occurred during processing
         at oracle.aurora.server.tools.loadjava.LoadJava.process(LoadJava.java:863)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:116)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:46)
         at oracle.jdevimpl.deploy.OracleDeployer.deploy(OracleDeployer.java:97)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:473)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:360)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeployToMostRecent(StoredProcHandler.java:256)
         at oracle.jdevimpl.deploy.StoredProcProfileDt$2.run(StoredProcProfileDt.java:193)

    I think u dont've previleges to run
    the procedure.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by arunr12:
    hi I am calling java stored procedure from jdbc. i am getting wierd exceptions:
    CallableStatement cstmt = conn.prepareCall("begin SEND_MAIL(?,?,?);end;");
    cstmt.setString(1,"[email protected]");
    cstmt.setString(2,"Mail from Stored Proc");
    cstmt.setString(3,"This is test mail from Oracle8i");
    cstmt.execute();
    i am getting following Exception:
    java.sql.SQLException: ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (java.util.PropertyPermission * read,write) has not been granted by dbms_java.grant_permission to SchemaProtectionDomain(ISTORE_CUST|PolicyTableProxy(ISTORE_CUST))
    ORA-06512: at "ISTORE_CUST.SEND_MAIL", line 0
    ORA-06512: at line 1
    <HR></BLOCKQUOTE>
    null

  • Out of memory error when calling a java stored procedure multiple times

    Trying to run a PL/SQL loop calling a java stored procedure, I get the following error:
    "ORA-04030: out of process memory when trying to allocate 262188 byte callheap,ioc_allocate free)"
    (with some other error lines).
    The stored procedure does two major things:
    1) Open a socket to communicate with a server, of which it queries some data.
    2) Use JDBC (with the default DB connection it has, as a stored procedure) to write the results to a table.
    All socket connections, statements, etc. are properly closed and all memory should be garbage collected between each call.
    Can anyone offer an explanation or additional checks to make? I'm quite sure the code isn't causing the problem, since I've tried running it as a stand alone application (outside of Oracle) and didn't have any problems.
    Thanks.

    Hi,
    Verify that the database parameters are set correctly.
    EA

  • While executing java stored procedure i got an error

    I have used this command to load java source into data base
    loadjava -user ENCORA/ENCORA C:\framework\Packages\testdevelopement\HOST.java
    but while executing i got an error.
    SQL> create or replace function run_cmd(p_cmd in varchar2) return number
    2 as
    3 language java
    4 name 'HOST.RunThis(java.lang.String[]) return integer';
    5 /
    Function created.
    SQL> create or replace procedure RC(p_cmd in varchar2)
    2 as
    3 x number;
    4 begin
    5 x := run_cmd(p_cmd);
    6 end;
    7 /
    Procedure created.
    SQL> set serveroutput on size 1000000
    SQL> exec dbms_java.set_output(1000000)
    PL/SQL procedure successfully completed.
    SQL> exec rc('/usr/bin/ps -ef');
    BEGIN rc('/usr/bin/ps -ef'); END;
    ERROR at line 1:
    ORA-29540: class HOST does not exist
    ORA-06512: at "ENCORA.RUN_CMD", line 0
    ORA-06512: at "ENCORA.RC", line 5
    ORA-06512: at line 1
    can any one suggest me how can i resolve this problem?

    Hi Uday,
    My guess is that there is a problem with your java stored procedure that is causing the "ExceptionInInitializer" error to be thrown. According to the javadoc:
    is thrown to indicate that an exception occurred during
    evaluation of a static initializer or
    the initializer for a static variable
    Since I didn't see any of your code in your post, I can't help you much more, I'm afraid. Perhaps if you would provide some more details, I may be able to help you some more. I think the following details would be helpful:
    1. Complete error message and stack trace you are getting.
    2. The section of your java code that you think is causing the problem.
    3. Oracle database version you are using.
    Good Luck,
    Avi.

  • Missing Imports in Java stored Procedure

    --- Oracle Database Configuration :-
    --- Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
    --- PL/SQL Release 9.2.0.4.0 - Production
    --- CORE 9.2.0.3.0 Production
    --- TNS for Solaris: Version 9.2.0.4.0 - Production
    --- NLSRTL Version 9.2.0.4.0 - Production
    When loading a java stored procedure into the above database I am seeing the following errors:-
    Class javax.xml.parsers.DocumentBuilder not found in import.
    Class javax.xml.parsers.DocumentBuilderFactory not found in import.
    Class javax.xml.parsers.FactoryConfigurationError not found in import.
    Class javax.xml.parsers.ParserConfigurationException not found in import.
    Class org.xml.sax.EntityResolver not found in import.
    Class org.xml.sax.InputSource not found in import.
    Class org.xml.sax.SAXException not found in import.
    Class org.xml.sax.SAXParseException not found in import.
    Class org.w3c.dom.Document not found in import.
    Interface ErrorHandler of class CMSLogic not found.
    However, the process results in no errors when running against a database running on a Windows platform.
    Assistance would be appreciated.
    Thanks.
    Adrian

    Adrian,
    Package "javax.xml" is part of the JDK since version 1.4
    However, Oracle 9i is compatible with JDK 1.3
    So either you need to find a 3rd-party implementation of package "javax.xml" that is compatible with JDK 1.3, or upgrade your database to Oracle 10g, which is compatible with JDK 1.4
    Good Luck,
    Avi.

Maybe you are looking for