db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Hill <Thomas.K.H...@t-online.de>
Subject ERROR 42X51 class not found
Date Sat, 24 Oct 2009 14:35:19 GMT
i,

I am trying to recreate data base objects (/ triggers) using java functions on a
Linux server after having them tested successfully by executing the DDL against
the derby network server running on localhost.

The development is done using the Apache Nature in the Eclipse IDE and with a
network server started on the same machine refered to as 'localhost' on the
connect statement. The java code is stored on the filesystem of that same
machine. I could create my data base objects as intended and the triggers are
working fine.

Now I wanted to deploy the solution onto my Linux server and am running into -
most probably classpath - problems. The java code I have copied to the java home
and also to the derby home folder on the server. the functions are defined as
public.

Here is what the sysinfo utility reports on my development machine (network
server run on localhost which is a windows machine):
------------------ Java Information ------------------
Java Version:    1.6.0_15
Java Vendor:     Sun Microsystems Inc.
Java home:       C:\Programme\Java\jre6
Java classpath:  C:\Daten\eclipse ganymede\derby;
                
C:\Programme\eclipse-ganymede-SR1\eclipse\plugins\
org.apache.derby.core_10.5.1\derby.jar;
                
C:\Programme\eclipse-ganymede-SR1\eclipse\plugins\
org.apache.derby.core_10.5.1\derbyclient.jar;
                
C:\Programme\eclipse-ganymede-SR1\eclipse\plugins\
org.apache.derby.core_10.5.1\derbynet.jar;
                
C:\Programme\eclipse-ganymede-SR1\eclipse\plugins\
org.apache.derby.core_10.5.1\derbytools.jar
OS name:         Windows XP
OS architecture: x86
OS version:      5.1
Java user name:  Thomas
Java user home:  C:\Dokumente und Einstellungen\Thomas
Java user dir:   C:\Daten\eclipse ganymede\derby
java.specification.name: Java Platform API Specification
java.specification.version: 1.6
--------- Derby Information --------
JRE - JDBC: Java SE 6 - JDBC 4.0
[C:\Programme\eclipse-ganymede-SR1\eclipse\plugins\
org.apache.derby.core_10.5.1\derby.jar]
10.5.1.1 - (764942)
[C:\Programme\eclipse-ganymede-SR1\eclipse\plugins\
org.apache.derby.core_10.5.1\derbytools.jar]
10.5.1.1 - (764942)
[C:\Programme\eclipse-ganymede-SR1\eclipse\plugins\
org.apache.derby.core_10.5.1\derbynet.jar]
10.5.1.1 - (764942)
[C:\Programme\eclipse-ganymede-SR1\eclipse\plugins\
org.apache.derby.core_10.5.1\derbyclient.jar]
10.5.1.1 - (764942)
------------------------------------------------------
----------------- Locale Information -----------------
------------------------------------------------------

Here is what sysinfo reports on the Linux server:
------------------ Java Information ------------------
Java Version:    1.6.0_12
Java Vendor:     Sun Microsystems Inc.
Java home:       /usr/lib/jvm/java-6-sun-1.6.0.12/jre
Java classpath:  /var/lib/derby/db-derby-10.5.3.0-bin/lib/derby.jar:
                 /var/lib/derby/db-derby-10.5.3.0-bin/lib/derbynet.jar:
                 /var/lib/derby/db-derby-10.5.3.0-bin/lib/derbytools.jar:
                 /var/lib/derby/db-derby-10.5.3.0-bin/lib/derbyclient.jar
OS name:         Linux
OS architecture: i386
OS version:      2.6.26-2-686
Java user name:  root
Java user home:  /root
Java user dir:   /root
java.specification.name: Java Platform API Specification
java.specification.version: 1.6
--------- Derby Information --------
JRE - JDBC: Java SE 6 - JDBC 4.0
[/var/lib/derby/db-derby-10.5.3.0-bin/lib/derby.jar] 10.5.3.0 - (802917)
[/var/lib/derby/db-derby-10.5.3.0-bin/lib/derbytools.jar] 10.5.3.0 - (802917)
[/var/lib/derby/db-derby-10.5.3.0-bin/lib/derbynet.jar] 10.5.3.0 - (802917)
[/var/lib/derby/db-derby-10.5.3.0-bin/lib/derbyclient.jar] 10.5.3.0 - (802917)
------------------------------------------------------
----------------- Locale Information -----------------
Current Locale :  [English/United States [en_US]]
Found support for locale: [cs]
	 version: 10.5.3.0 - (802917)
Found support for locale: [de_DE]
	 version: 10.5.3.0 - (802917)
Found support for locale: [es]
	 version: 10.5.3.0 - (802917)
Found support for locale: [fr]
	 version: 10.5.3.0 - (802917)
Found support for locale: [hu]
	 version: 10.5.3.0 - (802917)
Found support for locale: [it]
	 version: 10.5.3.0 - (802917)
Found support for locale: [ja_JP]
	 version: 10.5.3.0 - (802917)
Found support for locale: [ko_KR]
	 version: 10.5.3.0 - (802917)
Found support for locale: [pl]
	 version: 10.5.3.0 - (802917)
Found support for locale: [pt_BR]
	 version: 10.5.3.0 - (802917)
Found support for locale: [ru]
	 version: 10.5.3.0 - (802917)
Found support for locale: [zh_CN]
	 version: 10.5.3.0 - (802917)
Found support for locale: [zh_TW]
	 version: 10.5.3.0 - (802917)
------------------------------------------------------
miniserver:~

Here is the output IJ reports showing the DDL executed properly on localhost:
ij version 10.5
ij> CONNECT 'jdbc:derby://localhost:1527/test; create=true; user=derby';
ij> -- DROP TABLE "Clients";

CREATE TABLE "Clients"
(
  "ClientID"      varchar(16) NOT NULL,
  "ClientName"    varchar(64) NOT NULL,
  "RowID"         integer     NOT NULL generated always as identity,
  "CreatedBy"     varchar(64) NOT NULL DEFAULT CURRENT_USER,
  "CreatedOn"     timestamp   NOT NULL DEFAULT CURRENT_TIMESTAMP,
  "LastUpdatedBy" varchar(64) NOT NULL DEFAULT CURRENT_USER,
  "LastUpdatedOn" timestamp   NOT NULL DEFAULT CURRENT_TIMESTAMP,
  "DeletedBy"     varchar(64),
  "DeletedOn"     timestamp,
  CONSTRAINT "PK_Clients" PRIMARY KEY ("ClientID")
);
0 rows inserted/updated/deleted
ij> CREATE UNIQUE INDEX "UI_Clients_RowID" ON "Clients"("RowID");
0 rows inserted/updated/deleted
ij> -- DROP TRIGGER "TR_Clients_AI1";

CREATE TRIGGER "TR_Clients_AI1"
AFTER INSERT
ON "Clients"
REFERENCING NEW AS NEW
FOR EACH ROW 
	UPDATE rte."Clients"
	SET "CreatedBy"     = CURRENT_USER,
	    "CreatedOn"     = CURRENT_TIMESTAMP,
	    "LastUpdatedBy" = CURRENT_USER,
	    "LastUpdatedOn" = CURRENT_TIMESTAMP,
	    "DeletedBy"     = NULL,
	    "DeletedOn"     = NULL
	WHERE "RowID" = NEW."RowID";
ERROR 42Y07: Schema 'RTE' does not exist
ij> --DROP PROCEDURE "TF_Clients_AI2"; 

CREATE PROCEDURE "TF_Clients_AI2"(IN iRowID integer, IN vcClientID varchar(16),
IN vcClientName varchar(64))
LANGUAGE JAVA
  PARAMETER STYLE JAVA
  MODIFIES SQL DATA
  EXTERNAL NAME 'derbyPk.Functions.TF_Clients_AI2(java.lang.Integer,
java.lang.String, java.lang.String)';
0 rows inserted/updated/deleted
ij> -- DROP TRIGGER "TR_Clients_AI2";

CREATE TRIGGER "TR_Clients_AI2"
AFTER INSERT
ON "Clients"
REFERENCING NEW AS NEW
FOR EACH ROW 
CALL DERBY."TF_Clients_AI2"(NEW."RowID", NEW."ClientID", NEW."ClientName");
0 rows inserted/updated/deleted
ij> DISCONNECT;
ij> EXIT;

and here is the ij output when trying to do the same on my Linux machine

ij version 10.5
ij> CONNECT 'jdbc:derby://192.168.178.10:1527/test; create=true; user=derby';
ij> -- DROP TABLE "Clients";

CREATE TABLE "Clients"
(
  "ClientID"      varchar(16) NOT NULL,
  "ClientName"    varchar(64) NOT NULL,
  "RowID"         integer     NOT NULL generated always as identity,
  "CreatedBy"     varchar(64) NOT NULL DEFAULT CURRENT_USER,
  "CreatedOn"     timestamp   NOT NULL DEFAULT CURRENT_TIMESTAMP,
  "LastUpdatedBy" varchar(64) NOT NULL DEFAULT CURRENT_USER,
  "LastUpdatedOn" timestamp   NOT NULL DEFAULT CURRENT_TIMESTAMP,
  "DeletedBy"     varchar(64),
  "DeletedOn"     timestamp,
  CONSTRAINT "PK_Clients" PRIMARY KEY ("ClientID")
);
0 rows inserted/updated/deleted
ij> CREATE UNIQUE INDEX "UI_Clients_RowID" ON "Clients"("RowID");
0 rows inserted/updated/deleted
ij> -- DROP TRIGGER "TR_Clients_AI1";

CREATE TRIGGER "TR_Clients_AI1"
AFTER INSERT
ON "Clients"
REFERENCING NEW AS NEW
FOR EACH ROW 
	UPDATE rte."Clients"
	SET "CreatedBy"     = CURRENT_USER,
	    "CreatedOn"     = CURRENT_TIMESTAMP,
	    "LastUpdatedBy" = CURRENT_USER,
	    "LastUpdatedOn" = CURRENT_TIMESTAMP,
	    "DeletedBy"     = NULL,
	    "DeletedOn"     = NULL
	WHERE "RowID" = NEW."RowID";
ERROR 42Y07: Das Schema 'RTE' ist nicht vorhanden.
ij> --DROP PROCEDURE "TF_Clients_AI2"; 

CREATE PROCEDURE "TF_Clients_AI2"(IN iRowID integer, IN vcClientID varchar(16),
IN vcClientName varchar(64))
LANGUAGE JAVA
  PARAMETER STYLE JAVA
  MODIFIES SQL DATA
  EXTERNAL NAME 'derbyPk.Functions.TF_Clients_AI2(java.lang.Integer,
java.lang.String, java.lang.String)';
0 rows inserted/updated/deleted
ij> -- DROP TRIGGER "TR_Clients_AI2";

CREATE TRIGGER "TR_Clients_AI2"
AFTER INSERT
ON "Clients"
REFERENCING NEW AS NEW
FOR EACH ROW 
CALL DERBY."TF_Clients_AI2"(NEW."RowID", NEW."ClientID", NEW."ClientName");
ERROR 42X51: Die Klasse 'derbyPk.Functions' ist nicht vorhanden oder es kann
nicht auf die Klasse zugegriffen werden. Diese Situation kann eintreten, wenn
die Klasse nicht öffentlich ist.
ERROR XJ001: Java-Ausnahme: 
'derbyPk.Functions: java.lang.ClassNotFoundException'.
ij> DISCONNECT;
ij> EXIT;

Any help would be appreciated.

Thanks
Thomas



Mime
View raw message