If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Run DB2 Java Error - SQL4304N SQLSTATE 42724

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-08-06, 05:53
chewwt chewwt is offline
Registered User
 
Join Date: Sep 2005
Posts: 5
Run DB2 Java Error - SQL4304N SQLSTATE 42724

Hi,

Try to run a properly compiled Java procedure from DB2 Development Center encounter the error :

POINT.BCBUPLOADCAMPAIGN - Run started.
POINT.BCBUPLOADCAMPAIGN - Exception occurred while running:
A database manager error occurred.[IBM][CLI Driver][DB2/6000] SQL4304N Java stored procedure or user-defined function "POINT.BCBUPLOADCAMPAIGN", specific name "BCBUPLOADCAMPAIGN" could not load Java class "BCBUPLOADCAMPAIGN", reason code "1". SQLSTATE=42724


POINT.BCBUPLOADCAMPAIGN - Roll back completed successfully.
POINT.BCBUPLOADCAMPAIGN - Run failed.


The Environment is DB2 8.1.4 AIX 5.2.

These are the things I have performed/checked and still cannot resolve this problem:
  1. Update dbm cfg KEEPFENCED to "No" and db2stop/db2start the db instance
  2. Run db2 "call sqlj.refresh_classes()" manually even the DB2 Development Center did refresh the class while building it
  3. Confirm the jar file is located in "/home/devinst1/sqllib/function/jar/POINT/SQL61108053041820.jar
  4. Confirm CLASSPATH includes /home/devinst1/sqllib/function
  5. Drop the Java procedure and rebuild many times and the problem still persist
  6. Moved the jar file or class file to /home/devinst1/sqllib/function from /home/devinst1/sqllib/function/jar/POINT directory

The Java code is :

import java.sql.*; // JDBC classes
import java.math.*;
import java.util.*;
import java.text.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;

public class BCBUPLOADCAMPAIGN
{
public static void bCBUploadCampaign(String in_fileName, String[] mark1,
String[] mark2) throws SQLException {
String in_camp_code = "";
String in_comm_code = "";
String in_camp_name = "";
String in_camp_desc = "";
String in_aim = "";
String in_start_date = "";
String in_end_date = "";
String in_target_desc = "";
String sql = "";
String failReason = "";
.......


Below is the SQL statement for CREATE PROCEDURE POINT.BCBUPLOADCAMPAIGN after building the above Java source

CREATE PROCEDURE POINT.BCBUPLOADCAMPAIGN ( IN in_fileName VARCHAR(100),
OUT mark1 VARCHAR(400),
OUT mark2 VARCHAR(400) )
SPECIFIC BCBUPLOADCAMPAIGN
NOT DETERMINISTIC
LANGUAGE JAVA
EXTERNAL NAME 'POINT.SQL61108053041820:BCBUPLOADCAMPAIGN.bCBUplo adCampaign'
FENCED
NOT THREADSAFE
PARAMETER STYLE JAVA


Could someone give me some idea what else I can do to make this work?

Regards
WT
Reply With Quote
  #2 (permalink)  
Old 12-08-06, 07:59
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by chewwt
[*]Confirm CLASSPATH includes /home/devinst1/sqllib/function
Did you check your environment, or that of the fenced user?
Reply With Quote
  #3 (permalink)  
Old 12-11-06, 23:49
chewwt chewwt is offline
Registered User
 
Join Date: Sep 2005
Posts: 5
May I know any specific environment settings that I have to check? Also, how to find out the fenced users?

I have a few Java stored procedures in the same database. Some can be run while others encounter the same error. I have compared those Java programs that can run and those cannot run. I checked the SQL definition, the location of the Jar etc and see no difference.

Any help is much appreciated.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On