[Pljava-dev] Problems compiling under Mac OS X

From: thhal at mailblocks(dot)com (Thomas Hallgren)
To:
Subject: [Pljava-dev] Problems compiling under Mac OS X
Date: 2004-05-15 10:28:37
Message-ID: 40A5F0D5.70304@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

p3consulting wrote:

> Thomas,
>
> I think what could be the easiest is an independant shell script
> (triggered by make test) doing some automated testing (creating a new
> database, the tables, filling with some data, etc.) to see if
> everything is ok.

I agree. That's a good suggestion. I'll look into improving the tests. I
think I'll write the tests Java and spawn the JVM with correct classpath
using Ant rather than using make and shell-scripts though, to make it
more portable.

> Asking to look at another contrib like spi may be confusing...
> especially in case of trouble.

The Server Programming Interface (SPI) is not another contrib. It's an
integral part of the PostgreSQL core distribution and it's the function
package on which the Pl/Java JDBC driver is built. I agree it's not
ideal to refer to it but rather than copying and maintaining a vast
amount of information from the PostgreSQL manual (I have somewhat
limited resources ;-), I chosed to mention it in the user guide in order
to explain:

a) why some limitations are there that is due to the use of SPI.
b) that the JDBC connection runs within the same transaction as the invoker.
c) that detailed info regarding the command execution can be found,
reading about the SPI in the PostgreSQL manual.

> I suppose I would have to change it to:
>
> su - postgres -c 'sh -c "( export
> CLASSPATH=/Library/Java/Extensions/pljava.jar ;
> /usr/local/bin/postmaster -i -D /usr/local/pgsql/data >>
> /usr/local/pgsql/logs/logfile 2>&1 & )"'
>
> What do you think ? More to put in the CLASSPATH ? the postgresql.jar ?

Your suggested classpath looks OK. The postgresql.jar should not be in
the classpath since Pl/Java uses it's own JDBC driver that sits directly
on top of the SPI functions.

Another prerequisite is that the LD_LIBRARY_PATH is set so that the
postmaster can find the jvm shared lib (in the Java distribution).
Judging from the error you get, your setting must be correct, the pljava
shared lib wouldn't load at all if it was wrong.

Kind regards,

Thomas Hallgren

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Thomas Hallgren 2004-05-17 07:52:39 [Pljava-dev] Problems compiling under Mac OS X
Previous Message Thomas Hallgren 2004-05-14 19:16:58 [Pljava-dev] Problems compiling under Mac OS X