agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
Date: Wed, 13 Apr 2005 15:01:19 +0200
Message-ID: <425D181F.8090007@mailblocks.com> (raw)
In-Reply-To: <000b01c54026$8be12450$0301a8c0@manos>
References: <000b01c54026$8be12450$0301a8c0@manos>

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






view thread (6+ messages)  latest in thread

Message-ID: <425D181F.8090007@mailblocks.com>
Permalink:  ../425D181F.8090007@mailblocks.com/
Also on:    postgresql.org/message-id/425D181F.8090007@mailblocks.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] Error message java.lang.ClassNotFoundException: 'pljavatriggers.TestTrigger1'
  In-Reply-To: <425D181F.8090007@mailblocks.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox