Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009
    Posts
    2

    Unanswered: Can't build a java stored proc in DB2 Development Center

    Hi,

    I'm writing my first java stored proc. At this stage I'm just trying to get a stub example to build correctly. Below is the actual procedure:

    Code:
    package org.xenbase.database.proc;
    import java.sql.*;
    public class ALL_ALIGNED_PROBES_MQT_REFRESH
    {
    public static void ALL_ALIGNED_PROBES_MQT_REFRESH() throws SQLException, Exception
        {}
    }
    When I try to build the code in my DB2 Dev center (running on XP), I get the following message output:

    DB2INST1.ALL_ALIGNED_PROBES_MQT_REFRESH - Build started.
    C:\PROGRA~1\IBM\SQLLIB\java\jdk\bin\javac -classpath ".;C:\PROGRA~1\IBM\SQLLIB\java\db2java.zip;C:\PROG RA~1\IBM\SQLLIB\java\runtime.zip;C:\PROGRA~1\IBM\S QLLIB\java\sqlj.zip" org\xenbase\database\proc\ALL_ALIGNED_PROBES_MQT_R EFRESH.java
    DB2INST1.ALL_ALIGNED_PROBES_MQT_REFRESH - Javac completed.
    C:\PROGRA~1\IBM\SQLLIB\java\jdk\bin\jar cf SQL90412031809470.jar org\xenbase\database\proc\ALL_ALIGNED_PROBES_MQT_R EFRESH.class
    DB2INST1.ALL_ALIGNED_PROBES_MQT_REFRESH - Jar file created.
    Call SQLJ.DB2_INSTALL_JAR (<<C:\Documents and Settings\jarabek\Application Data\IBM\DB2\DC\Projects\bld1242249204970\SQL90412 031809470.jar>>, 'DB2INST1.SQL90412031809470', 0)
    [IBM][CLI Driver][DB2/LINUX] SQL4301N Java or .NET interpreter startup or communication failed, reason code "2". SQLSTATE=58004

    DB2INST1.ALL_ALIGNED_PROBES_MQT_REFRESH - Build failed.
    DB2INST1.ALL_ALIGNED_PROBES_MQT_REFRESH - Roll back completed successfully.

    I believe the key message in this error is:
    SQL4301N Java or .NET interpreter startup or communication failed, reason code "2". SQLSTATE=58004 DB2 info center says code 2 means "A Java Native Interface call to the Java interpreter failed". So for starters I don't even know what that error means, so obviously I'm stumped as to how to solve it.

    Given that I've written the procedure on my windows machine, but DB2 dev. center displays the stored procedure as being on the database which is on a linux server, I'm unclear as to where the procedure is being compiled / run.

    Here is the db2 server information:
    DB21085I Instance "db2inst1" uses "32" bits and DB2 code release "SQL08027"
    with level identifier "03080106".
    Informational tokens are "DB2 v8.1.0.128", "s061108", "MI00175", and FixPak
    "14".
    Product is installed at "/opt/IBM/db2/V8.1".

    All of the threads on this forum that seem to reference a similar problem seem to make reference to a setting called JDK11_PATH in the dbm cfg file. I don't appear to have any setting. The closest that exists on our server is: (JDK_PATH) = /opt/IBMJava2-141

    Any advice would be really appreciated.

    Sincerely,
    Jarabek
    Last edited by jarabek; 05-13-09 at 18:28.

  2. #2
    Join Date
    Oct 2003
    Location
    Curitiba - PR - Brazil
    Posts
    18
    Hi Jarabek,

    Does db2diag show any additional info?

    Try setting diaglevel to 4 and submit it again. Not sure it will give you more info, but would worth to give a try.
    Norberto Gasparotto Filho

    IBM Cert. DB2 v9 DBA
    IBM Cert. DB2 v9 App. Developer
    SCJP 5

  3. #3
    Join Date
    May 2009
    Posts
    2
    I just changed the diaglevel to 4, and resubmitted the procedure, it gave me no additional details on the failure.

  4. #4
    Join Date
    Dec 2008
    Posts
    76
    This is not strictly a database error. The problem is a conflict with the JVM installed on your machine; and, no, I'm sorry but I can't tell you how to fix it.
    Last edited by rdutton; 05-14-09 at 16:42.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •