Problem running examples.jar with official postgresql pljava deb

From: Bear Giles <bgiles(at)coyotesong(dot)com>
To: pljava-dev(at)lists(dot)postgresql(dot)org
Subject: Problem running examples.jar with official postgresql pljava deb
Date: 2022-03-05 21:10:10
Message-ID: CALBNtw5Wchp128n2-rgJ1ebjqw7sVW0fBw4A0gEH1ZasYjJ75w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

I'm wrapping up a new set of docker images for pljava -
https://hub.docker.com/beargiles/pljava - and hit a problem when installing
examples.jar to get the values to provide when registering the prebuilt
distributions.

Basically the official version of pl/java does not include saxon. I can
easily install the debian package and install the jars but I'm stuck
installing the example jar.

If I don't create the 'javatest' schema the execution fails because it
can't find the saxon jar.

postgres=# SELECT
sqlj.install_jar('file:///usr/share/postgresql/14/pljava/pljava-examples-1.6.4.jar',
'ex', true);
INFO: 05 Mar 22 21:01:28 org.postgresql.pljava.example.LoggerTest
aggregate examples ok
INFO: 05 Mar 22 21:01:28
org.postgresql.pljava.example.annotation.SPIActions issue 228 tests ok
ERROR: java.sql.SQLNonTransientException: resolving static method
org.postgresql.pljava.example.saxon.S9.like_regex with signature
(String,String,String,boolean)boolean: java.lang.ClassNotFoundException:
net.sf.saxon.trans.XPathException
CONTEXT: SQL statement "CREATE OR REPLACE FUNCTION javatest.like_regex(
value pg_catalog.varchar, pattern pg_catalog.varchar, flag
pg_catalog.varchar DEFAULT CAST(e'' AS pg_catalog.varchar), w3cNewlines
boolean DEFAULT CAST(e'false' AS boolean)) RETURNS boolean LANGUAGE java
VOLATILE AS
e'boolean=org.postgresql.pljava.example.saxon.S9.like_regex(java.lang.String,java.lang.String,java.lang.String,boolean)'"

If I do create the 'javetest' schema the execution fails because the
javatest schema already exists.

Nice Catch-22 there.

I tried adding the jars to both the 'public' and 'sqlj' schemas but no joy.

How can I get past this? Besides providing the information requested (which
I could get by looking at the underlying tables) I would like to be able to
execute the query just to have an automated way to verify a successful
installation.

Bear

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Bear Giles 2022-03-05 21:22:13 jOOQ custom data types for pl/java UDT
Previous Message Ilaria Battiston 2022-01-20 19:49:04 GSoC 2022 [-projects]