agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feed[Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
6+ messages / 0 participants
[nested] [flat]
* [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
@ 2005-04-13 12:44
2005-04-13 13:01 ` [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
0 siblings, 1 reply; 6+ messages in thread
From: @ 2005-04-13 12:44 UTC (permalink / raw)
Dear *,
I am trying to compose a Trigger using pljava and I am getting the error
message:
java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
Here are the steps I followed:
1) I created the TestTrigger1.java (belongs to package pljavatriggers..)
file and created testtrigger.jar in the directory
d:\pljavatriggers.
2) Then I created the trigger function with the following code
CREATE OR REPLACE FUNCTION sqlj.testfunction()
RETURNS "trigger" AS
$BODY$ 'pljavatriggers.TestTrigger1.execCommandLine'$BODY$
LANGUAGE 'javau' VOLATILE;
ALTER FUNCTION sqlj.testfunction() OWNER TO xristis;
GRANT EXECUTE ON FUNCTION sqlj.testfunction() TO xristis;
GRANT EXECUTE ON FUNCTION sqlj.testfunction() TO public;
3) The trigger was created
CREATE TRIGGER test_trigger
AFTER INSERT OR UPDATE
ON sqlj."Doctor"
FOR EACH STATEMENT
EXECUTE PROCEDURE sqlj.testfunction();
4) The jar was installed and it was added to classpath... SELECT
sqlj.install_jar('file:D:\\pljavatriggers\\testtrigger.jar','testtrigger',tr
ue);
SELECT sqlj.set_classpath('sqlj','testtrigger');
With no error messages...
When I try to execute an SQL Update query I get the error message
java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1' as mentioned
before
Can anyone tell me what I am missing ??
Thanx,
Manos
^ permalink raw reply [nested|flat] 6+ messages in thread
* [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
2005-04-13 12:44 [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
@ 2005-04-13 13:01 `
2005-04-13 15:24 ` [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
0 siblings, 1 reply; 6+ messages in thread
From: @ 2005-04-13 13:01 UTC (permalink / raw)
Manos Spanoudakis wrote:
>Dear *,
>
>I am trying to compose a Trigger using pljava and I am getting the error
>message:
>java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
>
>Here are the steps I followed:
>
>1) I created the TestTrigger1.java (belongs to package pljavatriggers..)
>file and created testtrigger.jar in the directory
>d:\pljavatriggers.
>2) Then I created the trigger function with the following code
>
>CREATE OR REPLACE FUNCTION sqlj.testfunction()
> RETURNS "trigger" AS
>$BODY$ 'pljavatriggers.TestTrigger1.execCommandLine'$BODY$
> LANGUAGE 'javau' VOLATILE;
>ALTER FUNCTION sqlj.testfunction() OWNER TO xristis;
>GRANT EXECUTE ON FUNCTION sqlj.testfunction() TO xristis;
>GRANT EXECUTE ON FUNCTION sqlj.testfunction() TO public;
>
>3) The trigger was created
>
>CREATE TRIGGER test_trigger
> AFTER INSERT OR UPDATE
> ON sqlj."Doctor"
> FOR EACH STATEMENT
> EXECUTE PROCEDURE sqlj.testfunction();
>
>4) The jar was installed and it was added to classpath... SELECT
>sqlj.install_jar('file:D:\\pljavatriggers\\testtrigger.jar','testtrigger',tr
>ue);
>SELECT sqlj.set_classpath('sqlj','testtrigger');
>
>With no error messages...
>
>When I try to execute an SQL Update query I get the error message
>java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1' as mentioned
>before
>
>Can anyone tell me what I am missing ??
>
>
You seem to do everything just right so I'll try a couple of long-shots:
1. Older versions of PL/Java has a bug that will force you to finish the
installation session and start a new session before the functions will
work properly. Are you using a version prior to 1.0.1?
2. If you list the testtrigger.jar file, is the TestTrigger1.class file
listed there and is it qualified with the package directory in the listing?
3. When you executed the above, did you by any chance execute the actual
update from another session then the one used for the install, and if
so, did you commit the installation?
Regards,
Thomas Hallgren
^ permalink raw reply [nested|flat] 6+ messages in thread
* [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
2005-04-13 12:44 [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
2005-04-13 13:01 ` [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
@ 2005-04-13 15:24 `
2005-04-13 16:36 ` [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
0 siblings, 1 reply; 6+ messages in thread
From: @ 2005-04-13 15:24 UTC (permalink / raw)
> -----Original Message-----
> From: Thomas Hallgren [mailto:thhal at mailblocks.com]
> Sent: Wednesday, April 13, 2005 4:01 PM
> To: Manos Spanoudakis
> Cc: pljava-dev at gborg.postgresql.org
> Subject: Re: [Pljava-dev] Error message
> java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
>
>
> Manos Spanoudakis wrote:
>
> >Dear *,
> >
> >I am trying to compose a Trigger using pljava and I am getting the
> >error
> >message:
> >java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
> >
> >Here are the steps I followed:
> >
> >1) I created the TestTrigger1.java (belongs to package
> >pljavatriggers..) file and created testtrigger.jar in the directory
> >d:\pljavatriggers.
> >2) Then I created the trigger function with the following code
> >
> >CREATE OR REPLACE FUNCTION sqlj.testfunction()
> > RETURNS "trigger" AS
> >$BODY$ 'pljavatriggers.TestTrigger1.execCommandLine'$BODY$
> > LANGUAGE 'javau' VOLATILE;
> >ALTER FUNCTION sqlj.testfunction() OWNER TO xristis;
> >GRANT EXECUTE ON FUNCTION sqlj.testfunction() TO xristis;
> GRANT EXECUTE
> >ON FUNCTION sqlj.testfunction() TO public;
> >
> >3) The trigger was created
> >
> >CREATE TRIGGER test_trigger
> > AFTER INSERT OR UPDATE
> > ON sqlj."Doctor"
> > FOR EACH STATEMENT
> > EXECUTE PROCEDURE sqlj.testfunction();
> >
> >4) The jar was installed and it was added to classpath... SELECT
> >sqlj.install_jar('file:D:\\pljavatriggers\\testtrigger.jar','
> testtrigge
> >r',tr
> >ue);
> >SELECT sqlj.set_classpath('sqlj','testtrigger');
> >
> >With no error messages...
> >
> >When I try to execute an SQL Update query I get the error message
> >java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1' as
> >mentioned before
> >
> >Can anyone tell me what I am missing ??
> >
> >
> You seem to do everything just right so I'll try a couple of
> long-shots:
>
> 1. Older versions of PL/Java has a bug that will force you to finish
> the installation session and start a new session before the
> functions will
> work properly. Are you using a version prior to 1.0.1?
I am using version 1.1.0b on Windows
> 2. If you list the testtrigger.jar file, is the
> TestTrigger1.class file
> listed there and is it qualified with the package directory
> in the listing?
Everything looks ok...
HOSPITAL=# select oid,entryid,jarid,entryname from sqlj.jar_entry WHERE
entryname LIKE '%Trigger1%';
oid | entryid | jarid | entryname
-------+---------+-------+-----------------------------------
34620 | 2 | 75 | pljavatriggers/TestTrigger1.class
(1 row)
HOSPITAL=# select * from sqlj.jar_repository;
jarid | jarname | jarorigin
| jarowner | deploymentdesc
-------+-------------+------------------------------------------------------
-----------------+----------+----------------
75 | testtrigger | file:D:\pljavatriggers\testtrigger.jar
| 1 |
77 | examples | file:d:\java\pljava\examples.jar
| 1 | 21
(2 rows)
>3. When you executed the above, did you by
> any chance execute the actual
> update from another session then the one used for the install, and if
> so, did you commit the installation?
How do I commit the installation?
> Regards,
> Thomas Hallgren
Thanks for your answer,
Manos
^ permalink raw reply [nested|flat] 6+ messages in thread
* [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
2005-04-13 12:44 [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
2005-04-13 13:01 ` [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
2005-04-13 15:24 ` [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
@ 2005-04-13 16:36 `
0 siblings, 0 replies; 6+ messages in thread
From: @ 2005-04-13 16:36 UTC (permalink / raw)
Manos Spanoudakis wrote:
>How do I commit the installation?
>
>
I mean a normal SQL commit. You probably commit each statement in psql
so it's not the likely cause.
Do you get any warnings or errors in the output log from the postmaster?
Do you use some strange CLASSPATH setting that may affect the postmaster?
Would it be possible for me to see your example? I.e. could you email
the jar file and perhaps the source as well? (if so, please send it to
my personal email. thhal at mailblocks.com).
What environment are you using? OS, Java version, PostgreSQL version?
Regards,
Thomas Hallgren
^ permalink raw reply [nested|flat] 6+ messages in thread
* [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
@ 2005-04-13 22:09
2005-04-14 00:16 ` [Pljava-dev] Error message java.lang.ClassNotFoundException:'pljavatriggers.TestTrigger1' SOLVED
0 siblings, 1 reply; 6+ messages in thread
From: @ 2005-04-13 22:09 UTC (permalink / raw)
Manos,
Take a look at your ClassNotFoundException once more. Do you see the
leading single quote just before the name of the class? This qoute stems
from the $body$ '...' $body$ that you're using. Essetially you get two
single qoutes at the beginning and two at the end. PostgreSQL strips the
outer quotes and delivers the rest to PL/Java as a method name. I
suggest you remove the $body$ on both sides.
A couple of other suggestions.
- The CLASSPATH visible to the backend should *only* contain the
pljava.jar. Alternatively it could be empty and instead set using
pljava.classpath in postgresql.conf.
- Your execCommandLine(TriggerData) method must be static or PL/Java
will fail to find it.
- Don't use the sqlj schema for user defined stuff. It should be
regarded as reserved for PL/Java. The sqlj schema as a whole will be
uninstalled if you redeploy pljava.
Regards,
Thomas Hallgren
^ permalink raw reply [nested|flat] 6+ messages in thread
* [Pljava-dev] Error message java.lang.ClassNotFoundException:'pljavatriggers.TestTrigger1' SOLVED
2005-04-13 22:09 [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
@ 2005-04-14 00:16 `
0 siblings, 0 replies; 6+ messages in thread
From: @ 2005-04-14 00:16 UTC (permalink / raw)
> -----Original Message-----
> From: pljava-dev-bounces at gborg.postgresql.org
> [mailto:pljava-dev-bounces at gborg.postgresql.org] On Behalf Of
> Thomas Hallgren
> Sent: Thursday, April 14, 2005 1:10 AM
> To: Manos Spanoudakis; pljava-dev
> Subject: Re: [Pljava-dev] Error message
> java.lang.ClassNotFoundException:'pljavatriggers.TestTrigger1'
>
>
> Manos,
> Take a look at your ClassNotFoundException once more. Do you see the
> leading single quote just before the name of the class? This
> qoute stems
> from the $body$ '...' $body$ that you're using. Essetially
> you get two
> single qoutes at the beginning and two at the end. PostgreSQL
> strips the
> outer quotes and delivers the rest to PL/Java as a method name. I
> suggest you remove the $body$ on both sides.
The problem was with the $body$ ! Thanks !!
> A couple of other suggestions.
> - The CLASSPATH visible to the backend should *only* contain the
> pljava.jar. Alternatively it could be empty and instead set using
> pljava.classpath in postgresql.conf.
> - Your execCommandLine(TriggerData) method must be static or PL/Java
> will fail to find it.
Indeed :)
> - Don't use the sqlj schema for user defined stuff. It should be
> regarded as reserved for PL/Java. The sqlj schema as a whole will be
> uninstalled if you redeploy pljava.
> Regards,
> Thomas Hallgren
Regards,
Manos
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2005-04-14 00:16 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-13 12:44 [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
2005-04-13 13:01 `
2005-04-13 15:24 `
2005-04-13 16:36 `
2005-04-13 22:09 [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
2005-04-14 00:16 ` [Pljava-dev] Error message java.lang.ClassNotFoundException:'pljavatriggers.TestTrigger1' SOLVED
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox