Web Server forum
Back To The Forum Home!Search!Private Messaging System

This is Interesting: Free IT Magazines Now Free shipping to   
Web Server Talk Web Server Talk > Free Databases support forum > IBM DB2 > development center build fails




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    development center build fails  
hubert_s


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-30-04 03:39 PM


I have DB2 8.1 FP7, when I try to build a Java stored procedure it fails
during a call to DB2_REPLACE_JAR. Even the build folder "bld1096553970703"
is not there  - it has a different name,

regards,
Hubert

DB2ADMIN.PROCEDURE2 - Build started.
DROP SPECIFIC PROCEDURE DB2ADMIN.SQL030805133228210
DB2ADMIN.PROCEDURE2 - Drop stored procedure completed.
 C:\PROGRA~1\IBM\SQLLIB\java\jdk\bin\java
c -classpath
".;C:\PROGRA~1\IBM\SQLLIB\java\db2java.zip;C:\PROGRA~1\IBM\SQLLIB\java\runti
me.zip;C:\PROGRA~1\IBM\SQLLIB\java\sqlj.zip";"c:\jt400.jar"
procedure22.java
DB2ADMIN.PROCEDURE2 - Javac completed.
C:\PROGRA~1\IBM\SQLLIB\java\jdk\bin\jar cf SQL30705013217030.jar
procedure22.class
DB2ADMIN.PROCEDURE2 - Jar file created.
Call SQLJ.DB2_REPLACE_JAR (<<C:\Documents and
Settings\db2admin\Application
 Data\IBM\DB2\DC\Projects\bld109655397070
3\SQL30705013217030.jar>>,
'DB2ADMIN.SQL30705013217030')
[IBM][CLI Driver][DB2/NT] SQL0444N  Routine "SQLJ.DB2_REPLACE_JA
R"
(specific name "") is implemented with code in library or path "",
function "" which cannot be accessed.  Reason code: "".  SQLSTATE=42724

DB2ADMIN.PROCEDURE2 - Build failed.
DB2ADMIN.PROCEDURE2 - Roll back completed successfully.






[ Post a follow-up to this message ]



    Re: development center build fails  
Andrew Murchison


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-03-04 01:55 AM

The stored procedure builder and related tools were rebuilt in V82 to
use the Java JCC driver instead of the old JDBC.  Due to some
limitations of JCC, DB2 had to implement some cataloged versions of the
SQLJ-schema functions (install_jar, replace_jar) that took BLOB objects
as parameters instead of filenames.  Here's a sample Java program that
uses them - very basic, it just demonstrates their use:

import java.sql.*;
import java.lang.*;
import java.io.*;

//argv[0] -- database connection string (JCC format)
//argv[1] -- username
//argv[2] -- password
//argv[3] -- first JAR file
//argv[4] -- second JAR file
public class testinstjar
{
public static void main(String[] argv) throws Exception
{
Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
Connection conn = DriverManager.getConnection(argv[0], argv[1],
argv[2]);

CallableStatement stmt = conn.prepareCall("CALL
SQLJ.DB2_INSTALL_JAR(?, ?)");
FileInputStream jarFile = new FileInputStream(argv[3]);
stmt.setBinaryStream(1, jarFile, jarFile.available());
stmt.setString(2, "MYJARID");
stmt.execute();
System.out.println("Installjar complete");

stmt.close();
stmt = conn.prepareCall("CALL SQLJ.DB2_REPLACE_JAR(?, ?)");
jarFile = new FileInputStream(argv[4]);
stmt.setBinaryStream(1, jarFile, jarFile.available());
stmt.setString(2, "MYJARID");
stmt.execute();
System.out.println("replacejar complete");

stmt.close();
stmt = conn.prepareCall("CALL SQLJ.REMOVE_JAR(?)");
stmt.setString(1, "MYJARID");
stmt.execute();
System.out.println("removejar complete");

stmt.close();
conn.close();
}
}

NOTE: at this time, these functions are not documented for a reason --
they are ONLY intended for use with the stored procedure builder.
However, they function exactly like the normal SQLJ-schema functions
that have filenames for parameters, except that instead of filenames, a
BLOB representing the file is given instead.

In this case, although I'm not sure why, it looks like the procedure
builder is passing the engine some bad data (in the form of a
non-existent file) and that's resulting in a funny error.

A -444 usually means that a library (or function on that library) could
not be found, but I don't think that's the case here.  I would check the
engine's <install>\bin\routine (<install> is typically c:\sqllib)
directory and ensure that a file called db2jarsp.dll is present
(assuming your server is on a Windows machine).

However, as you say, the file that is being installed simply does not
exist on your client.  That would lead me to think that the problem is
starting on the procedure builder, which then calls the
SQLJ.DB2_REFRESH_JAR() procedure to update the JAR file with some bad
data, which somehow results in the rather unusual -444 error you are seeing.

It might be worthwhile to contact IBM DB2 support about this.  It may be
nice for them if you could run the test Java program above just to
ensure that the DB2_REFRESH_JAR (and install and remove procedures) are
actually working in normal conditions on your system.  Any simple JAR
files will do - so long as they are actual JAR files containing java
classes.

hubert_s wrote:

> I have DB2 8.1 FP7, when I try to build a Java stored procedure it fails
> during a call to DB2_REPLACE_JAR. Even the build folder "bld1096553970703"
> is not there  - it has a different name,
>
> regards,
> Hubert
>
> DB2ADMIN.PROCEDURE2 - Build started.
> DROP SPECIFIC PROCEDURE DB2ADMIN.SQL030805133228210
> DB2ADMIN.PROCEDURE2 - Drop stored procedure completed.
>  C:\PROGRA~1\IBM\SQLLIB\java\jdk\bin\java
c -classpath
> ".;C:\PROGRA~1\IBM\SQLLIB\java\db2java.zip;C:\PROGRA~1\IBM\SQLLIB\java\run
time.zip;C:\PROGRA~1\IBM\SQLLIB\java\sqlj.zip";"c:\jt400.jar"
> procedure22.java
> DB2ADMIN.PROCEDURE2 - Javac completed.
> C:\PROGRA~1\IBM\SQLLIB\java\jdk\bin\jar cf SQL30705013217030.jar
> procedure22.class
> DB2ADMIN.PROCEDURE2 - Jar file created.
> Call SQLJ.DB2_REPLACE_JAR (<<C:\Documents and
> Settings\db2admin\Application
>  Data\IBM\DB2\DC\Projects\bld109655397070
3\SQL30705013217030.jar>>,
> 'DB2ADMIN.SQL30705013217030')
> [IBM][CLI Driver][DB2/NT] SQL0444N  Routine "SQLJ.DB2_REPLACE_
JAR"
> (specific name "") is implemented with code in library or path "",
> function "" which cannot be accessed.  Reason code: "".  SQLSTATE=42724
>
> DB2ADMIN.PROCEDURE2 - Build failed.
> DB2ADMIN.PROCEDURE2 - Roll back completed successfully.
>





[ Post a follow-up to this message ]



    Re: development center build fails  
amurchis


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-05-04 10:52 PM

Actually... if you've updated from an earlier fixpak of DB2 V8, have you
run the "db2updv8" utility to update the function/procedure definitions
to include the new ones included to FP7?

hubert_s wrote:
> I have DB2 8.1 FP7, when I try to build a Java stored procedure it fails
> during a call to DB2_REPLACE_JAR. Even the build folder "bld1096553970703"
> is not there  - it has a different name,
>
> regards,
> Hubert
>
> DB2ADMIN.PROCEDURE2 - Build started.
> DROP SPECIFIC PROCEDURE DB2ADMIN.SQL030805133228210
> DB2ADMIN.PROCEDURE2 - Drop stored procedure completed.
>  C:\PROGRA~1\IBM\SQLLIB\java\jdk\bin\java
c -classpath
> ".;C:\PROGRA~1\IBM\SQLLIB\java\db2java.zip;C:\PROGRA~1\IBM\SQLLIB\java\run
time.zip;C:\PROGRA~1\IBM\SQLLIB\java\sqlj.zip";"c:\jt400.jar"
> procedure22.java
> DB2ADMIN.PROCEDURE2 - Javac completed.
> C:\PROGRA~1\IBM\SQLLIB\java\jdk\bin\jar cf SQL30705013217030.jar
> procedure22.class
> DB2ADMIN.PROCEDURE2 - Jar file created.
> Call SQLJ.DB2_REPLACE_JAR (<<C:\Documents and
> Settings\db2admin\Application
>  Data\IBM\DB2\DC\Projects\bld109655397070
3\SQL30705013217030.jar>>,
> 'DB2ADMIN.SQL30705013217030')
> [IBM][CLI Driver][DB2/NT] SQL0444N  Routine "SQLJ.DB2_REPLACE_
JAR"
> (specific name "") is implemented with code in library or path "",
> function "" which cannot be accessed.  Reason code: "".  SQLSTATE=42724
>
> DB2ADMIN.PROCEDURE2 - Build failed.
> DB2ADMIN.PROCEDURE2 - Roll back completed successfully.
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:47 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 

Back To The Top
Home | Usercp | Faq | Register