Product Documentation

Knowledgebase

Previous Topic

Next Topic

Stored Procedure Java Class Resolution

Occasionally a stored procedure does not behave as expected. One possible cause can be improper resolution of the Java class. For example, a custom jar in the CLASSPATH may include a class using the same name as our stored procedures generate.

The class resolution can be traced using these procedures:

  1. Add the followig to ctsrvr.cfg:
    SETENV DH_JVM_OPTION_STRINGS=-verbose:class;-verbose:jni

    (DH_JVM_OPTION_STRINGS may contain a variety of Java options, for example, you may be increasing the default Java heap size with -Xmx, etc. Simply add the verbose options to the string.)

  2. Start ctreesql.exe from the command line, and redirect stderr to a file:
    ctreesql.exe 1>err.log
  3. Connect and call the stored procedure in question (e.g., admin.p_sp_getfddversion()).
  4. Check err.log for the results.

    Here is the expected load of procedure in err.log:

    [Loaded admin_p_sp_getfddversion_SP from __JVM_DefineClass__]

    Here is an unexpected version being loaded from a .class file sitting in the CLASSPATH:

    [Loaded admin_p_sp_getfddversion_SP from file:/Q:/ctreesrc/ipv6/ctreeAPI/bin.sql/data/]

TOCIndex